fix(logging): stop reporting failed /v1/log sends as error beacons (feedback loop)#102
Draft
darrenli-rokt wants to merge 1 commit into
Conversation
LoggingService.log() reported a failed /v1/log POST to the error endpoint (/v1/errors). When /v1/log is rate-limited the 429 surfaces to fetch as a "Failed to fetch" TypeError, so each dropped log emits an error beacon that is itself rate-limited — a self-amplifying feedback loop at the log frequency. Make diagnostics-log sends fire-and-forget. ReportingTransport already logs the failure to the console; genuine errors still flow through ErrorReportingService. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
803b7d0 to
66c13d3
Compare
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
LoggingService.log()reports a failed/v1/logPOST as an error to/v1/errors. When/v1/logis rate-limited, the 429 surfaces tofetchas aTypeError: Failed to fetch, so each dropped log emits an error beacon that is itself rate-limited — a self-amplifying feedback loop at the log frequency.This path is reachable on any page once logging is enabled via config (#98) and now that the
ROKT_DOMAINgate has been removed (#99): a rate-limited client turns dropped/v1/logbeacons into/v1/errorstraffic.Fix
Make diagnostics-log sends fire-and-forget — do not re-report a failed log send as an error.
ReportingTransportalready logs the failure to the console; genuine errors continue to flow throughErrorReportingService.Test
LoggingServicefetch-error test to assert no error beacon is emitted on send failure (fire-and-forget).npm run lintclean ·npm test205/205 pass ·npm run buildOK.dist/intentionally not committed (regenerated by release automation).Draft — note for reviewers
This addresses the rate-limit→error feedback loop. The same fire-and-forget /
Failed to fetchsuppression likely applies to the identity and timings beacon-send paths. Separately, genuine identity-resolution errors (IDENTITY_REQUEST/IDENTITY_MISMATCH) are a distinct issue to track on their own.