Repository navigation
✨ Treat upstream HTTP and fetch failures as transient, match bare D1 internal error - #7
Merged
Merged
Conversation
…internal error Workers kept opening issues for origin 5xx/429, fetch network failures, timeouts and D1's bare "internal error" (no reference). Add isTransientOriginStatus/isTransientOriginError, match the bare D1 message with an anchored pattern, and fingerprint origin errors as cloudflare-transient. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
dryan
approved these changes
Oct 26, 2026
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.
What
src/d1.ts:isTransientD1Erroralso matches the bareinternal error(with or without theD1_ERROR:prefix) via an anchored pattern. A message that merely contains the words is not matched.src/origin.ts:isTransientOriginStatus(408, 425, 429, 500 to 530) andisTransientOriginError(transientstatus/statusCode, fetch network failures,TimeoutError/AbortError; walkscauseand AggregateError). Exported from the index.src/sentry.ts:groupCloudflareErrorsfingerprints origin errors ascloudflare-transient.Why
Origin 5xx/429, fetch failures, timeouts and D1's bare "internal error" each opened their own issues instead of grouping as transient.
Serves:
npm test(tsc + vitest): 76 passed.🤖 Generated with Claude Code