Fix three overnight Sentry issues - #377
Conversation
…axError noise). Retry Turso 502/503/504 in saferFetch and skip capture when retries exhaust; drop standalone prisma transaction spans and minified-chunk SyntaxError events without app frames. Fixes WEBSITE-31 Fixes WEBSITE-32 Fixes WEBSITE-1T Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| beforeSendTransaction(event: TransactionLike): TransactionLike | null { | ||
| return shouldDropSentryTransaction(event) ? null : event | ||
| }, | ||
| ignoreErrors: [...NEXTJS_CONTROL_FLOW_ERRORS, "Unexpected token '{'"] |
There was a problem hiding this comment.
Bug: The ignoreErrors option for "Unexpected token '{'" unconditionally drops errors, preventing the beforeSend handler from correctly preserving legitimate app-frame errors.
Severity: MEDIUM
Suggested Fix
Remove "Unexpected token '{'" from the ignoreErrors array in src/lib/sentry/shared-options.ts. The filtering logic for this specific error is already handled correctly within the beforeSend handler (shouldDropClientEvent), which properly checks for the presence of an application stack frame before deciding whether to drop the event. This change will ensure all filtering for this error is consolidated in one place.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/lib/sentry/shared-options.ts#L34
Potential issue: The `ignoreErrors` configuration in `sentrySharedOptions` includes
`"Unexpected token '{'"`. This creates an unconditional filter that runs early in
Sentry's event processing pipeline. As a result, any error with this message is dropped
before the `beforeSend` handler is called. This contradicts the logic in
`shouldDropClientEvent`, which is designed to only drop these errors if they lack an
application stack frame. Consequently, legitimate application errors, such as a
`JSON.parse` failure in `BungieClient.ts`, could be silently ignored instead of being
reported for debugging.
Did we get this right? 👍 / 👎 to inform future reviews.
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
502/503/504insaferFetchand skip Sentry capture for exhaustedPrismaClientKnownRequestErrorSERVER_ERROR blips onprofile.getUniqueprisma:client:operationtransactions inbeforeSendTransaction(Turso latency flagged as slow DB query, not an app bug)SyntaxError: Unexpected token '{'from minified chunks / bots (no/src/frames) viashouldDropClientEvent+ignoreErrorsTest plan
bun run lintis:unresolved project:website→ 0APP_VERSIONreleaseMade with Cursor