Skip to content

fix(tickets): recover from a GraphQL field skew instead of a raw error page - #261

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixtickets-stop-one-unknown-graphql-8b43d2
Draft

fix(tickets): recover from a GraphQL field skew instead of a raw error page#261
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixtickets-stop-one-unknown-graphql-8b43d2

Conversation

@posthog

@posthog posthog Bot commented Aug 20, 2026

Copy link
Copy Markdown

Problem

  • Admins hit a full-page error on /tickets and the raw server payload is dumped on screen with no way to recover — a core flow blocked for the rest of the session (two independent session recordings, six days apart, one tenant and one QA host).
  • The list and board send one GraphQL document, so one field the deployed schema does not declare fails validation for the whole query.
  • extractGraphQlData throws the first GraphQL error, the hook passes error.message straight through, and the table/board render it as <PageError message={error} /> — a raw banner with no retry.
  • Two live skews trigger it: escalatedByUser (frontend gated on ai-escalation, backend field added later) and the label→tag rename.

Changes

  • Degrade one field skew instead of blanking the surface. TicketService.fetchGraphQl detects a FieldUndefined validation error, prunes the undeclared leaf field, and retries once — so escalatedByUser just comes back absent (no badge) rather than emptying the board.
  • No raw error text. The table and board now render an inline LoadError with generic copy and a working retry, keeping the page chrome (title, back button, view switch) so the page stays usable. Removed the duplicate raw-message toast.
  • No pointless retries. react-query skips its retries for deterministic schema-validation errors (retry: 2 → guarded).
  • Safety net. Wrapped the /tickets route in ContentErrorBoundary, matching the notifications / logs / scripts routes.
Field skew Before After
Undeclared leaf (escalatedByUser) Empty board / raw banner Loads; badge absent
Other validation error Raw banner, no retry Generic inline error + retry

Test plan

  • vitest run — added utils/graphql.test.ts (undefined-field parsing, leaf pruning, typed validation error); full suite 58 passing.
  • biome check clean on changed files.
  • tsc introduces no new errors in the touched files (pre-existing @/__generated__/* relay-codegen errors are unrelated).

Note

The tickets UI lives in this repo; the originating report is filed against openframe-saas-tenant, which deploys this shared frontend. Not deployed here, so the fix was verified by unit tests and the exact render-path change rather than a live reproduction.


Created with PostHog Desktop from this inbox report.

…r page

One field the deployed schema does not declare fails validation for the whole
tickets document. The table and board rendered the raw server error full-page
with no retry, blocking a core flow for the rest of the session.

- Prune an undeclared leaf field and retry once in `TicketService`, so a single
  field skew (e.g. `escalatedByUser`) degrades to a missing badge, not an empty
  board or list.
- Replace the raw `PageError` on the table and board with an inline `LoadError`
  that keeps the page chrome and offers a working retry; never show the raw
  server payload.
- Skip react-query retries for deterministic schema-validation errors.
- Wrap the tickets route in `ContentErrorBoundary`, matching sibling routes.

Generated-By: PostHog Desktop
Task-Id: fd82f8ce-ef9a-454e-994c-518cf8907ec2
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.

0 participants