Skip to content

Mitigate intermittent PostgREST JWT errors on first load - #46

Merged
jackwsmth merged 2 commits into
mainfrom
fix/retry-postgrest-future-jwt
Sep 22, 2026
Merged

jackwsmth merged 2 commits into
mainfrom
fix/retry-postgrest-future-jwt

Conversation

@jackwsmth

Copy link
Copy Markdown
Collaborator

What this changes

Production visitors reported that the first page load sometimes shows “Something went wrong / JWT issued at future,” while a subsequent reload succeeds. Retry page-data reads automatically when the configured Supabase REST endpoint returns HTTP 401 with exactly PGRST303 / JWT issued at future.

Retries wait 250 ms, 750 ms, then 1500 ms and reuse the same credentials. Successful retries let the page load normally; persistent failures still reach the existing error state. Other errors, writes, and auth requests are not retried. Aborted requests do not issue another retry.

PostgREST issue and limits

This symptom matches a known PostgREST stale time-cache bug that can reject valid JWTs as issued in the future. See upstream fix #5208, released in PostgREST 14.18 and 16.3, and Supabase's incident report. Supabase's September 17 update says affected projects will need an official dashboard upgrade once its new version is available.

This is a bounded client-side mitigation, not a fix for the underlying server timing bug or a guarantee of recovery. The production PostgREST version and the exact cause of the reported failure have not been verified. Durable remediation belongs in Supabase's managed update; no custom PostgREST build is required. This PR does not refresh tokens, clear sessions, or change hosted services.

Checks

  • TypeScript checking passes through npm --prefix frontend run build (tsc -b && vite build).
  • Production build passes.
  • npm --prefix frontend run results:test passes: 25 tests, including recovery, retry exhaustion, request scope, error preservation, cancellation, and network failures.
  • Catalog and UI copy are unchanged.

@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
intelinside Ready Ready Preview Sep 22, 2026 5:37pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
No result files to import.

Site / sign up · Workflow details and retry

@jackwsmth

Copy link
Copy Markdown
Collaborator Author

This can likely be removed after the Supabase fix goes live and the upgrade is done via the dashboard.

@jackwsmth
jackwsmth merged commit 203e37c into main Sep 22, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — f14ec45d Deployed Sep 22, 2026 by vercel[bot]
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.

1 participant