Skip to content

feat: add Sentry error capture to API routes and sidebar components (#81)#86

Merged
zacharias-ona merged 1 commit intomainfrom
feat/81-sentry-error-capture
Apr 16, 2026
Merged

feat: add Sentry error capture to API routes and sidebar components (#81)#86
zacharias-ona merged 1 commit intomainfrom
feat/81-sentry-error-capture

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

Closes #81

What

Adds captureSupabaseError / Sentry.captureException calls to all silent error paths in API routes, sidebar components, and related client components. Adds toast.error() notifications for user-facing failures.

Changes

API route (src/app/api/search/route.ts):

  • supabase.rpc error path now calls captureSupabaseError
  • Outer catch block captures the error variable and calls Sentry.captureException

Sidebar (page-tree.tsx):

  • Workspace lookup .then() checks for error
  • All operations (create, delete, swap, nest, unnest, drop) capture errors via captureSupabaseError and show toast.error() on failure
  • Promise.all results checked individually for .error

Sidebar (page-search.tsx):

  • Workspace lookup .then() checks for error
  • Search fetch catch block captures the exception via Sentry.captureException

Workspace home (workspace-home.tsx):

  • Page create failure captured + toast

Editor (image-plugin.tsx):

  • Replaced console.error with captureSupabaseError for upload failures

Page menu (page-menu.tsx):

  • Replaced console.error with Sentry.captureException / captureSupabaseError for export and import errors

Static analysis (sentry.test.ts):

  • Removed all files from BARE_CATCH_PENDING_ALLOWLIST and CONSOLE_ERROR_PENDING_ALLOWLIST

Testing

  • pnpm lint — clean
  • pnpm typecheck — clean
  • pnpm test — 50/50 tests pass (including static analysis regression tests)

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

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

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 16, 2026 0:57am

Request Review

@zacharias-ona zacharias-ona merged commit 28f185c into main Apr 16, 2026
6 checks passed
@zacharias-ona zacharias-ona deleted the feat/81-sentry-error-capture branch April 16, 2026 13:02
@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

⚠️ UI verification found design spec violations. See #87.

Summary: 9 new toast.error() calls are missing { duration: 8000 }, defaulting to 4s instead of the required 8s for error toasts per .agents/design.md.

@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ Post-merge verification passed.

Ad-hoc smoke tests — all passed:

  • / — landing page loads, has title
  • /sign-in — renders with email input
  • /api/health — returns healthy status
  • Authenticated login — redirects to workspace
  • Workspace page — fully loads
  • Editor navigation — page button click navigates to editor, contenteditable element renders

Skipped:

  • /dashboard (route does not exist)

E2E suite note: 14 of 27 E2E tests failed, but all failures are pre-existing and unrelated to this PR:

  • 12 editor tests (toolbar, link, slash-commands) fail because beforeEach matches buttons with /ago/ but freshly-created test pages show "just now" — the editor page never opens
  • 2 tests (editor-drag, page-crud) fail because getByRole('button', { name: /new page/i }) matches both the sidebar and workspace home buttons

These are test selector/timing issues that predate PR #86. The live application is functioning correctly.

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.

Add Sentry error capture to API routes and sidebar components

1 participant