fix(replay): Capture aborted/errored fetch requests in replay network tab#20722
Open
nicohrubec wants to merge 1 commit intodevelopfrom
Open
fix(replay): Capture aborted/errored fetch requests in replay network tab#20722nicohrubec wants to merge 1 commit intodevelopfrom
nicohrubec wants to merge 1 commit intodevelopfrom
Conversation
… tab Aborted or network-errored fetch requests were completely absent from the replay network tab because `_isFetchHint()` required `hint.response` to be present. The error path in the breadcrumb handler creates hints without a `response` property, causing the guard to return false and silently skip replay network capture. Change the guard to check `hint.input` instead (the fetch args array), which is present in both success and error breadcrumb hints. The downstream functions (`enrichFetchBreadcrumb`, `captureFetchBreadcrumbToReplay`) already accept `Partial<FetchHint>` and handle undefined `response`. Fixes JS-2374 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
logaretm
approved these changes
May 8, 2026
Member
logaretm
left a comment
There was a problem hiding this comment.
I dug into the history a bit. The response check seems to come from when this handler originally typed FetchHint as requiring a Response, so it looks like it was mostly a type/runtime-shape guard for the successful fetch path, not an intentional decision to exclude failed or aborted fetches.
Previous check also didn't return a boolean so this one should be actually better.
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.
Fetch requests that are aborted or fail before receiving response headers never appear in the replay network tab. Reproducible by calling
fetch()with anAbortControllerthat fires before headers arrive. With this setup the request shows up in Sentry breadcrumbs (on the error objects) but is missing from the replay network tab._isFetchHint()gates onhint.responseexisting, but when a fetch errors or is aborted the breadcrumb handler in the breadcrumb integration creates a hint with the error asdataand noresponse(since none was received). Changed the guard to checkhint.inputinstead, which is always present.Not sure if there was a specific reason to guard on the response here, in that case we can look into alternative solutions. With the current setup at least I get the request to show up in the replay network tab:

Fixes #20714