Skip to content

fix: hide Retry connection on a rate-limited sign-in, clear it on I already have a code - #1802

Merged
nedtwigg merged 1 commit into
mainfrom
fix/issue-1801
Nov 28, 2026
Merged

nedtwigg merged 1 commit into
mainfrom
fix/issue-1801

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

Fixes the two sign-in banner problems listed under "Also seen in the same walkthrough" in #1801. The main problem, where sign-in drops the enrollment, is not touched here.

  • 429 showed "Retry connection". Every failed auth action produced the same PageError, so the banner always offered a connection retry, even for a rate limit whose message says to wait. A 429 from json() in hosted/src/api.ts now throws RateLimitedError, pageError marks it wait, and the banner leaves the button out. A failed account read still goes through asRead → ReadFailed, so it keeps its retry.
  • The banner stayed after "I already have a code". That button only called setEnterCode(true). It now calls a haveCode handler, which clears the action's error and notice with keepRead the same way Change email does. An unanswered failed read stays visible.

Two new tests in hosted/src/App.test.tsx (a rate-limited code send) failed before the change and pass after it. Hosted's tsc --noEmit and the full src/ vitest run (70 tests) pass.

The enrollment-loss part of #1801 needs a decision first: keep the pending code in sessionStorage until ENROLLMENT_TTL_MS, or let Dormouse reopen or copy the link. Either one changes the memory-only rule in docs/specs/hosted.md → "Burrow enrollment".

Refs #1801 — automated triage

…lready have a code

A 429 from an auth action now throws RateLimitedError, and the page's
error banner omits Retry connection for it. Switching to I already have a
code clears an action's error and notice, as Change email already does.

Refs #1801
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3af1f52
Status: ✅  Deploy successful!
Preview URL: https://1b8f799b.mouseterm.pages.dev
Branch Preview URL: https://fix-issue-1801.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The Argos checks are red on this head: storybook-chromium and storybook-webkit each report "1 changed, waiting for your decision". The only story this PR changes is SignIn → RateLimited, which now sets wait: true and so drops the Retry connection button. A one-snapshot diff in each browser is that intended change. Approving the build in Argos (chromium, webkit) should clear it. Every other check passed.

@nedtwigg
nedtwigg merged commit 66ef595 into main Nov 28, 2026
19 checks passed
@nedtwigg
nedtwigg deleted the fix/issue-1801 branch November 28, 2026 18:13
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.

2 participants