Skip to content

Fix three overnight Sentry issues - #377

Merged
owens1127 merged 2 commits into
mainfrom
fix/sentry-overnight-issues
Jun 18, 2026
Merged

Fix three overnight Sentry issues#377
owens1127 merged 2 commits into
mainfrom
fix/sentry-overnight-issues

Conversation

@owens1127

Copy link
Copy Markdown
Contributor

Summary

  • WEBSITE-31 — Retry Turso 502/503/504 in saferFetch and skip Sentry capture for exhausted PrismaClientKnownRequestError SERVER_ERROR blips on profile.getUnique
  • WEBSITE-32 — Drop standalone prisma:client:operation transactions in beforeSendTransaction (Turso latency flagged as slow DB query, not an app bug)
  • WEBSITE-1T — Filter SyntaxError: Unexpected token '{' from minified chunks / bots (no /src/ frames) via shouldDropClientEvent + ignoreErrors

Test plan

  • bun run lint
  • CI green
  • After deploy: is:unresolved project:website → 0
  • Deploy sync resolves WEBSITE-31, WEBSITE-32, WEBSITE-1T in APP_VERSION release

Made with Cursor

…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>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
raid-hub Ready Ready Preview Jun 18, 2026 12:19pm

Request Review

beforeSendTransaction(event: TransactionLike): TransactionLike | null {
return shouldDropSentryTransaction(event) ? null : event
},
ignoreErrors: [...NEXTJS_CONTROL_FLOW_ERRORS, "Unexpected token '{'"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@owens1127
owens1127 merged commit 0abd632 into main Jun 18, 2026
6 of 7 checks passed
@owens1127
owens1127 deleted the fix/sentry-overnight-issues branch June 18, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant