Repository navigation
fix(router): stop reporting browser network failures from route loaders - #846
Draft
posthog[bot] wants to merge 2 commits into
Draft
posthog[bot] wants to merge 2 commits into
posthog[bot] wants to merge 2 commits into
Conversation
A route loader fetch that gets no response rejects with a bare TypeError, for example when the browser cancels the request during a full-page navigation. The router defaultOnCatch sent these to error tracking as new issues. Skip capture for known browser network-failure TypeErrors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: bcaca723-7de3-463d-a541-1453786b8141
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: bcaca723-7de3-463d-a541-1453786b8141
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
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.
Problem
ensureQueryData. When the browser cancels that request (for example on a full-page navigation),fetchrejects with a bareTypeError: Failed to fetch.defaultOnCatchsends every loader error to PostHog, so this networkTypeErrorbecomes an error-tracking issue.Origin
6b4e1daChanges
defaultOnCatchnow skips capture forTypeErrors that have a known browser network-failure message.isNetworkErrorinsrc/lib/network-error.tsholds the message list:Failed to fetchNetworkError when attempting to fetch resource.Load failedTypeError. OtherTypeErrors (for exampleCannot read properties of undefined) still go to error tracking.Note
The error screen behavior does not change. A real network drop still shows
AppErrorScreen. Only the report to error tracking stops.Testing
vitest --project=node src/lib/network-error.test.ts: 2 tests pass.vp checkon the changed files: no format, lint, or type errors.Agent context
fetchQuerydoes not retry by default. A retry does not help a request that the browser cancels during unload, and it makes a real outage show the error screen later. We can add it as a separate change if real network drops cause user complaints.capturePostHogClientException, so the other capture paths keep their current behavior.Closes #845
Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.