Skip to content

fix: harden maintenance recovery handling - #323

Open
Tiancheng-Xu wants to merge 3 commits into
Solvro:devfrom
Tiancheng-Xu:fix/maintenance-page-followup
Open

fix: harden maintenance recovery handling#323
Tiancheng-Xu wants to merge 3 commits into
Solvro:devfrom
Tiancheng-Xu:fix/maintenance-page-followup

Conversation

@Tiancheng-Xu

Copy link
Copy Markdown

Follow-up to #314 after rebasing the maintenance fixes onto the current dev branch.

Changes

  • trigger maintenance mode only for browser-side HTTP 503 responses, including the post-refresh retry path;
  • keep SSR and ordinary network failures on the normal error path;
  • reload only after a confirmed healthy polling response and retain polling failures as diagnostics;
  • add focused regression coverage for these boundaries.

Validation

  • pnpm test --run src/__tests__/maintenance.spec.tsx — 11 passed
  • targeted ESLint — passed
  • pnpm format:check — passed
  • pnpm typecheck — passed after the repository build generated Next types
  • next build --webpack with non-secret local validation placeholders — passed
  • git diff --check origin/dev...HEAD — passed

Copilot AI lite review requested due to automatic review settings September 7, 2026 09:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are small, align with the stated maintenance-mode boundaries, and include focused regression coverage for the adjusted SSR vs browser behavior.

Pull request overview

This PR hardens the “maintenance mode” recovery flow so that the app only enters maintenance mode for browser-side HTTP 503 responses, while SSR and non-503 failures continue through the regular error handling path. It also improves recovery polling behavior and adds targeted regression tests to lock these boundaries in.

Changes:

  • Narrow maintenance-mode triggering to 503 responses only when a real browser window is present (avoids SSR triggering).
  • Preserve polling errors for diagnostics during maintenance by logging failures, while still reloading only on a healthy status response.
  • Add a regression test ensuring SSR-like 503 handling stays on the normal error path.
File summaries
File Description
src/services/base-api.service.ts Restricts maintenance triggering to browser runtime by checking globalThis.window for non-null/defined.
src/components/maintenance.tsx Logs polling failures for diagnostics and adjusts overlay layout width.
src/__tests__/maintenance.spec.tsx Adds coverage to ensure server-side 503 responses do not trigger maintenance mode behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants