fix(reporting): don't beacon transport/network-failure error reports#103
Draft
darrenli-rokt wants to merge 1 commit into
Draft
Conversation
ErrorReportingService.report() beacons every report to /v1/errors. When a report
merely describes a failed network request — e.g. an identity request that failed
with "Failed to fetch" (also how a rate-limited 429 surfaces when its response is
CORS-blocked or dropped) — beaconing it emits another request that is itself
rate-limited/blocked, feeding back into the same per-IP limit.
Drop reports whose message matches a browser network-failure phrase
("Failed to fetch" / "Load failed" / Firefox / "Network request failed").
Genuine application errors (other messages) are still reported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
ErrorReportingService.report()beacons every report to/v1/errors. Many reports merely describe a failed network request — most commonly an identity request that failed withFailed to fetch(which is also how a rate-limited429surfaces when its response is CORS-blocked or dropped). Beaconing such a report emits another request to/v1/errorsthat is itself rate-limited/blocked, feeding back into the same per-IP limit — a self-amplifying loop.Fix
Drop reports whose message matches a browser network-failure phrase (
Failed to fetch/Load failed/ Firefox'sNetworkError when attempting to fetch resource/Network request failed). Genuine application errors (any other message) are still reported.Test
it.eachover the three network-failure phrasings → asserts no beacon is sent.e.split is not a function) → still beaconed.npm run lintclean ·npm test209/209 ·npm run buildOK.dist/not committed (regenerated by release automation).Notes for reviewers
LoggingServicefire-and-forget fix (separate PR) — together they stop the/v1/logand/v1/errorsbeacon paths from re-reporting their own rate-limited/blocked sends.ROKT_DOMAINgate was removed (fix: Remove ROKT_DOMAIN gate from logging #99).