-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] New Fetch keepAlive support can cause duplicate events to be sent during unload processing #1736
Comments
This fix for this will be that when sending a fetch (with keepalive) enabled the code will need to "assume" this as a fire and forget operation (like it does for sendBeacon()) -- this does mean however, that if a partial response is received (generally unlikely) that events may be lost vs the current situation which causes event duplication. |
Recently I noticed the duplicate event issue for myself with using the unload event from JS. I set onunloadDisableFetch flag to true and it is resolved the duplicate events. I didn't see this on our angular apps, even though we use a similar approach. Putting a comment here to follow the issue \\ code without the flag set that was creating dups
|
Deploying to final CDN endpoint |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When a browser supports fetch with keepAlive and this is used during page unload, if the page completes page navigation before the response can be processed any sent events will be sent on the next page load.
As a workaround you can disable the fetch keepalive support with the following config
onunloadDisableFetch
: trueThe text was updated successfully, but these errors were encountered: