feat(browser): Use fetch keepalive flag#5697
Merged
Conversation
added 2 commits
September 6, 2022 09:22
AbhiPrasad
approved these changes
Sep 6, 2022
Contributor
size-limit report 📦
|
3 tasks
3 tasks
This was referenced Mar 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on #5676 I noticed some navigation transactions don't show up in Sentry. I found out that when navigating between pages, Chrome cancels any outgoing requests - including requests to Sentry.
Events not being sent because of a page navigation probably happens the most with navigation transactions, since we usually finish the transaction right before we navigate (finishing happens implicitly on navigation). To requests being cancelled, we can use
fetch'skeepaliveflag to keep outgoing requests alive, even when we're switching pages.#2547 has an excellent writeup on the pros and cons of this flag. In short:
keepaliveisn't supported by Firefoxkeepalive: trueand a content length of > 64 kibibytes returns a network errorThis change definitely isn't a solution to solve this problem in 100% of the cases but it is our best effort to improve the status quo.
Resolves #2547