It is hard to debug web app close flow as process termination is aggressive.
When user closes the browser tab, the app run flow is not guaranteed.
Logs and breakpoints may be skipped.
This is understandable.
It would be great if browser could be put in debug mode where process termination was less aggressive making it easier to debug the app's close flow.