Skip to content

fix(assets): prevent Sentry spam from transient Supabase HTML errors#2234

Merged
DonKoko merged 1 commit intomainfrom
fix-supabase-storage-html-error-when-refreshing-images-2
Dec 5, 2025
Merged

fix(assets): prevent Sentry spam from transient Supabase HTML errors#2234
DonKoko merged 1 commit intomainfrom
fix-supabase-storage-html-error-when-refreshing-images-2

Conversation

@DonKoko
Copy link
Copy Markdown
Contributor

@DonKoko DonKoko commented Dec 5, 2025

When Supabase returns HTML error pages (504 timeouts, CDN errors) instead of JSON, the storage client throws StorageUnknownError. Previously, even after retry attempts, these errors were sent to Sentry.

Changes:

  • Mark persistent HTML errors as shouldBeCaptured: false in createSignedUrl
  • Preserve shouldBeCaptured flag when wrapping errors in refresh-main-image
  • Add specific error type for better debugging (persistent_html_error)
  • Ensure ShelfErrors are re-thrown as-is to preserve their flags

This prevents transient Supabase infrastructure issues from spamming Sentry while still logging them for debugging and gracefully falling back to existing URLs.

Fixes Sentry issue #7059127706

When Supabase returns HTML error pages (504 timeouts, CDN errors) instead
of JSON, the storage client throws StorageUnknownError. Previously, even
after retry attempts, these errors were sent to Sentry.

Changes:
- Mark persistent HTML errors as shouldBeCaptured: false in createSignedUrl
- Preserve shouldBeCaptured flag when wrapping errors in refresh-main-image
- Add specific error type for better debugging (persistent_html_error)
- Ensure ShelfErrors are re-thrown as-is to preserve their flags

This prevents transient Supabase infrastructure issues from spamming Sentry
while still logging them for debugging and gracefully falling back to
existing URLs.

Fixes Sentry issue #7059127706
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 5, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
shelf-docs Ignored Ignored Dec 5, 2025 1:01pm

@DonKoko DonKoko merged commit a066245 into main Dec 5, 2025
7 checks passed
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