Description
21 call sites across 10 component files use raw lazyCaptureException instead of the error-classifying captureSupabaseError. This causes transient Supabase errors (network timeouts, connection resets, PGRST500) to be reported at error level in Sentry instead of warning level.
This is the #1 recurring bug pattern — 13 Sentry-related bugs in the past 3 weeks (#856, #834, #828, #811, #810, #806, #734, #686, #648, #606, #599, #592, #578) were caused by missing error classification. Each time a new feature is added with raw lazyCaptureException, the same class of bug recurs.
Acceptance Criteria
Dependencies
None
Technical Notes
captureSupabaseError (in src/lib/sentry.ts) classifies errors by type and reports transient/expected errors at warning level. Raw lazyCaptureException reports everything at error level.
- Most of the raw calls are in outer
catch blocks that wrap Supabase client operations (uploads, queries, mutations). These should use captureSupabaseError with a context string.
- The 2 error boundary files (
global-error.tsx, route-error.tsx) correctly use raw capture — React error boundaries catch rendering errors, not Supabase errors.
demo-editor.tsx catches errors from editor.parseEditorState() — this is a Lexical error, not Supabase. Keep raw lazyCaptureException there.
- Reference
src/lib/sentry.ts for the full list of classified error types.
- Reference
.agents/conventions.md for error handling patterns.
Description
21 call sites across 10 component files use raw
lazyCaptureExceptioninstead of the error-classifyingcaptureSupabaseError. This causes transient Supabase errors (network timeouts, connection resets, PGRST500) to be reported aterrorlevel in Sentry instead ofwarninglevel.This is the #1 recurring bug pattern — 13 Sentry-related bugs in the past 3 weeks (#856, #834, #828, #811, #810, #806, #734, #686, #648, #606, #599, #592, #578) were caused by missing error classification. Each time a new feature is added with raw
lazyCaptureException, the same class of bug recurs.Acceptance Criteria
lazyCaptureExceptioncalls in the following files are replaced withcaptureSupabaseErrorwhere the caught error originates from a Supabase operation:src/components/sidebar/page-search.tsx(2 calls)src/components/database/csv-export-button.tsx(1 call)src/components/database/views/table-cell.tsx(5 calls)src/components/database/property-types/files.tsx(1 call)src/components/page-cover.tsx(2 calls)src/components/page-menu.tsx(2 calls)src/components/editor/database-plugin.tsx(1 call)src/components/editor/image-plugin.tsx(2 calls)src/components/editor/editor.tsx(1 call)src/components/editor/demo-editor.tsx(1 call — may be non-Supabase, keep raw if so)"table-cell:update-value")global-error.tsxandroute-error.tsxkeep rawlazyCaptureException— these are React error boundaries, not Supabase operationspnpm lint && pnpm typecheck && pnpm testpassDependencies
None
Technical Notes
captureSupabaseError(insrc/lib/sentry.ts) classifies errors by type and reports transient/expected errors atwarninglevel. RawlazyCaptureExceptionreports everything aterrorlevel.catchblocks that wrap Supabase client operations (uploads, queries, mutations). These should usecaptureSupabaseErrorwith a context string.global-error.tsx,route-error.tsx) correctly use raw capture — React error boundaries catch rendering errors, not Supabase errors.demo-editor.tsxcatches errors fromeditor.parseEditorState()— this is a Lexical error, not Supabase. Keep rawlazyCaptureExceptionthere.src/lib/sentry.tsfor the full list of classified error types..agents/conventions.mdfor error handling patterns.