Skip to content

fix(web): keep signed-in shell visible through auth outages - #807

Merged
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
claude/session-gate-outage-resilience
Aug 23, 2026
Merged

fix(web): keep signed-in shell visible through auth outages#807
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
claude/session-gate-outage-resilience

Conversation

@zachdunn

Copy link
Copy Markdown
Member

What

During an auth outage (like today's D1 stalls), the session gate's background revalidation returns "unavailable" — and until now that blanked the entire already-rendered app into the blocking "Authentication is temporarily unavailable" screen, even though the user's identity was already known from the sessionStorage cache or the SSR seed.

Now resolveSessionGate treats an outage with a known identity as a soft failure:

  • The painted shell stays visible (the outage panel stays hidden).
  • get-session retries in the background at 10s / 30s / 60s — matched to the observed ~10s stall windows — then gives up quietly (the next navigation re-gates).
  • A retry that finds the session signed out still redirects to /login; a role mismatch still shows denied.
  • A visit with no known identity (cold cache, first load) keeps the blocking screen — there's nothing meaningful to render.

This is safe because the cache was always a UX affordance only: every API call re-enforces the real session server-side, so page data degrades to its own per-request error states while the chrome stays usable.

Why now

Follow-up to #805/#806. With get-session bounded at 4s, a D1 stall window turns into fast 503s — correct fail-fast behavior, but the gate was amplifying one failed revalidation into a full-app hard failure on pages that were already rendered and usable.

Testing

  • 4 new resolveSessionGate tests: shell stays up on unavailable-with-cache, stays up through exhausted retries, still blocks with no identity, redirects when a retry finds signed-out.
  • Full apps/web suite: 58 files / 867 tests green.

When the session gate's revalidation returns "auth unavailable" but an
identity is already known (sessionStorage cache or the SSR seed), keep the
painted shell up and retry get-session in the background (10s/30s/60s)
instead of blanking the whole app into the blocking "try again" screen.
Auth outage is not a sign-out: every API call still enforces the real
session server-side, so page data degrades to its own error states while
the chrome stays usable.

A visit with no known identity still gets the blocking screen, and a
background retry that finds the session signed out redirects to /login as
before. Surfaced by the 2026-08-23 D1 stall incident, where 4s-bounded
get-session 503s were flipping fully-rendered pages into the hard failure
state.
@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 484dd28

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 23, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-web 484dd28 Commit Preview URL

Branch Preview URL
Aug 23 2026, 11:03 PM

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed) (1)
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 797cbe5c-7568-40dd-93f2-f529563dce7a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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