Skip to content

fix: replace raw lazyCaptureException with captureSupabaseError in 10 component files #913

@sw-factory-automations

Description

@sw-factory-automations

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

  • All lazyCaptureException calls in the following files are replaced with captureSupabaseError where 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)
  • Each replacement includes a descriptive context string (e.g., "table-cell:update-value")
  • global-error.tsx and route-error.tsx keep raw lazyCaptureException — these are React error boundaries, not Supabase operations
  • No functional behavior changes — only error classification level changes
  • Existing unit and E2E tests pass
  • pnpm lint && pnpm typecheck && pnpm test pass

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions