Open mstahv opened 5 months ago
Might be I was holding it wrong. FF at least sometimes don't properly do beacon request. https://bugzilla.mozilla.org/show_bug.cgi?id=1609653
I wouldn't be surprised if this is just the way some browser implementations work and there's nothing we can do about it.
We have seen this Firefox problem also in our Vaadin 8 integration tests, as they are run both in Chrome and Firefox.
The workaround with Firefox is to do it in the old fashioned way: https://github.com/TatuLund/vaadin-create23/blob/master/vaadincreate-ui/src/main/java/org/vaadin/tatu/vaadincreate/VaadinCreateUI.java#L77
Description of the bug
It looks like the detach event is not firer "eagerly" when leaving the page (using a beacon request) when Firefox is used. With Safari I also noticed some issues with one project, but can't reproduce with a fresh project (some caching issue mayby on Safari 🤷♂️). With Chrome it always works.
Expected behavior
The detach event should be fired whan navigating away or closing the window within a reasonable time.
Minimal reproducible example
Override onDetach and see when it actually happens.
Versions
Flow: 24.3.9 Vaadin: 24.3.10 Java: Eclipse Adoptium 22.0.1 OS: aarch64 Mac OS X 14.4.1 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0