Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit efe30f6. Configure here.
s1gr1d
reviewed
Oct 20, 2026
s1gr1d
left a comment
Member
There was a problem hiding this comment.
Thank you so much for picking this up!
a small nit regarding the tests: they are all quite similar so you could use an it.each there, like this:
it.each([
['a relative path', 'https://app.example.com/dashboard?tab=billing', '/api/users/42', 'Failed to fetch (app.example.com)'],
])('resolves %s against location.href', async (_name, href, target, expected) => {}| /** Internal global with common properties and Sentry extensions */ | ||
| export type InternalGlobal = { | ||
| navigator?: { userAgent?: string; maxTouchPoints?: number }; | ||
| location?: { origin?: string }; |
Member
There was a problem hiding this comment.
following the other comment
Suggested change
| location?: { origin?: string }; | |
| location?: { href?: string }; |
…nd an absolute URL on a different origin than the page
kunal649
force-pushed
the
kunal/fix/fetch-error-relative-url
branch
from
October 20, 2026 16:47
efe30f6 to
dc615b1
Compare
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.

enhanceFetchErrorMessagesalready adds the host to generic fetch errors, soFailed to fetchbecomesFailed to fetch (example.com). The catch is that it rannew URL(url)with no base, and that throws for relative URLs like/api/fooor thefetch("")from the issue. The try/catch swallowed the error, so those requests never got the host.Now relative URLs are resolved against
location.originif there is one (the browser tracing code already passes the same thing asurlBase). Absolute URLs ignore the base, and where there's nolocation(Node, workers) nothing changes. I also skip the enhancement when the resolved host is empty, like onfile://pages, otherwise you'd getFailed to fetch ().locationis added toInternalGlobalfor the typing.I added six unit tests (relative URL, empty URL, no
location,file://origin, opaquenullorigin, absolute URL on another origin).This only touches the error message. The empty URL in the fetch breadcrumbs is a separate spot, so I left it out to discuss on the issue thread.
Fixes #13168