Repository navigation
Conversation
kunal649
requested review from
Lms24 and
msonnb
and removed request for
a team
November 7, 2026 13:33
This branch has not been deployed
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.
Why:
fetch('')is instrumented, butxhr.open('GET', '')was not, and once an empty URL request is instrumented its breadcrumb showsurl: "". This PR fixes bothxhr.tsbailed on!url, which treats an empty string like an unparseable argument, so empty-URL XHRs got no breadcrumb and no span. It now only bails onurl === undefined, so XHR matches fetch."". Query and fragment are stripped withstripUrlQueryAndFragment, so params like?token=from the page URL don't end up in breadcrumbs. Since an empty URL resolves to the page URL itself, the helper useslocation.hrefdirectly instead of callingnew URL()(bcoz its throws for hrefs likeabout:srcdoc). without alocationobject (e.g. workers), nothing changes.Only empty URLs are rewritten, absolute and relative URLs keep their current breadcrumb behaviour.
How to review:
Start with:
packages/browser-utils/src/instrumentation/xhr.tspackages/browser/src/integrations/breadcrumbs.tsand the regression coverage in:
packages/browser-utils/test/instrumentation/xhr.test.tspackages/browser/test/integrations/breadcrumbs.test.tsThe key things to check are that only empty URLs are rewritten, and that the query and fragment are stripped from the page URL in all three breadcrumb paths (fetch, failed fetch, XHR).
Unsure about:
Whether relative URLs (like
/api/foo?x=1) should also be resolved againstlocation.hrefand stripped in breadcrumbs. I kept this limited to empty URLs so the change stays scoped, but yeah I'm happy to widen it.Ref #13168