FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Route-segment errors are never reported to Sentry and replace the whole shell · Issue #422 · Mogplex/mogplex · GitHub

Route-segment errors are never reported to Sentry and replace the whole shell #422

Description

Problem

Only app/global-error.tsx calls Sentry.captureException, and Next only renders that boundary when the root layout throws. The two segment boundaries render a message and report nothing. Nineteen of twenty dashboard segments have no error.tsx or loading.tsx at all, so a database hiccup on any of them blows up to the root boundary and replaces sidebar, top bar and status bar with a bare centred error. The root boundary also renders the raw error.message to the user.

Where

  • app/global-error.tsx:14-16 (the only Sentry call).
  • app/error.tsx (no Sentry, renders error.message at line 15).
  • app/(dashboard)/[scope]/settings/error.tsx (no Sentry).
  • Segments without boundaries: observability, projects, agents, flows, automations, workflows, delivery, triggers, assignments, library, primitives, runs, observe, control.

Fix

  1. Create one shared client component components/route-error.tsx that calls Sentry.captureException(error) in an effect, shows "Something went wrong" plus the digest, and a Try again button. Do not render error.message.
  2. Make app/error.tsx and the settings boundary render that component.
  3. Add app/(dashboard)/[scope]/error.tsx rendering the same component. Because it sits inside the dashboard layout, the shell stays up and only the page area shows the error.
  4. Add app/(dashboard)/[scope]/loading.tsx with a simple skeleton so navigation between segments shows progress instead of a frozen page.

Exit criteria

  • Playwright spec tests/e2e/route-error-boundary.spec.ts: force a page to throw the way the existing failure specs do (see how tests/e2e/control-composer-failure.spec.ts injects failures; if no page-level hook exists, add a test-only query param honoured only when the e2e flag is set), assert the sidebar stays visible, the raw error message is not in the DOM, and the Try again button re-renders the page.
  • Manual hosted-preview follow-up: temporarily throw from app/(dashboard)/[scope]/agents/page.tsx, confirm the sidebar stays visible and an event lands in Sentry. This verification was completed after merge in an isolated preview; the temporary throw was never in main, and its local source edit was restored.
  • rg -n 'error.message' app/**/error.tsx returns nothing.
  • pnpm lint, pnpm typecheck, pnpm test pass.

Out of scope

Per-segment custom error copy. One shared component is the goal.

https://claude.ai/code/session_01SQ4nS96XYRztd5w9QkubPf

Verification note: PR #559 adds automated client and server page-failure tests below the dashboard layout. The browser captures a real Sentry SDK exception envelope through an isolated transport and verifies shell retention, hidden error text, digest display, and recovery with server refetch. The initial regression verification used an isolated SDK transport. Hosted preview verification was subsequently completed as recorded below.

Hosted follow-up verified on 2026-10-03 at 04:39 UTC with normal email/password authentication. The Agents page displayed the safe error screen and reference 1271875240 while retaining the sidebar, top bar, and status bar. Sentry received the exact test exception "Mogplex hosted route-boundary verification 422 0404" in the preview environment, plus the masked client boundary exception. Removing the test query navigated successfully to the real Agents roster. No authentication bypass or PLAYWRIGHT flag was used. Temporary source edits were restored.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Reliability or a user-visible class of bug.bugSomething isn't workinginfrareliabilityStuck states, races, lifecycle gaps.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL