Skip to content

Fix production startup recovery state - #122

Open
BrandDead wants to merge 1 commit into
main-tL2525from
fix/production-startup-resilience
Open

Fix production startup recovery state#122
BrandDead wants to merge 1 commit into
main-tL2525from
fix/production-startup-resilience

Conversation

@BrandDead

@BrandDead BrandDead commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces the blank application frame that occurred when the lazy-loaded App module rejected during bootstrap because Supabase frontend configuration was missing.

  • Adds a bootstrap-safe StartupErrorBoundary around both lazy entry points.
  • Shows a player-readable configuration recovery state and retry action for missing Supabase variables.
  • Shows a neutral recovery state for other startup failures.
  • Adds focused component tests for both failure paths.

Validation

  • npm run test -- --run src/components/system/StartupErrorBoundary.test.tsx
  • npm run typecheck
  • npm run validate
  • Browser smoke: explicit non-demo production build without Supabase variables renders the recovery screen rather than a blank frame.

Notes

This does not replace deployment configuration. Production still requires valid Supabase variables; this change makes failure diagnosable and recoverable for players and operators.


Note

Low Risk
Bootstrap-only UX and error handling; production still requires valid Supabase configuration and no auth or data paths are changed.

Overview
When lazy-loaded App (or the graphics lab entry) fails during bootstrap—commonly because supabase.ts throws on missing env vars—players previously saw an empty frame. main.tsx now wraps both lazy entry paths in StartupErrorBoundary, which catches render/bootstrap failures and shows a styled recovery screen instead of a blank app.

The boundary detects Supabase configuration errors by message and shows SYSTEM CONFIGURATION REQUIRED with deployment guidance; other failures get a neutral SYSTEM UNAVAILABLE message. Both paths offer a RETRY STARTUP button that reloads the page. App.css adds bootstrap-safe styles for that screen (no dependency on the App module). Vitest tests cover both failure modes.

Reviewed by Cursor Bugbot for commit 72641d4. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
slide Ready Ready Preview Sep 1, 2026 9:53pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T21:54:26.049216Z 72641d4 PR opened
🔒 Security Review Completed 2026-09-01T21:54:13.098287Z 72641d4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72641d4408

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/main.tsx
<App />
</React.Suspense>
)}
<StartupErrorBoundary>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record this startup change in the project log

This introduces meaningful production startup and recovery behavior, but the commit does not append a dated entry to docs/PROJECT_LOG.md; that leaves the repository's required decision and rollback record incomplete. Add an entry describing the new error boundary, recovery behavior, and validation performed.

AGENTS.md reference: AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

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