Skip to content

fix(registration): blame the connection, not the captcha, when nothing answered - #365

Merged
Ardnived merged 2 commits into
mainfrom
fix/submit-failure-copy
Nov 5, 2026
Merged

Ardnived merged 2 commits into
mainfrom
fix/submit-failure-copy

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Every atlas registration has been failing in production. SahajCloud's CORS preflight did not allow x-turnstile-token, so the browser dropped each POST unsent. The server fix is fix(api): allow the Turnstile token header through CORS preflight SahajCloud#1085. This PR fixes what the visitor was told, and adds a lane that catches the contract breaking.
  • What the visitor saw (reported 2026-11-05 on /uk/london/1326/register): the captcha said "Success!", then after Register it showed "Something went wrong — The security check needs doing again", in blue. That advice could not help, because the captcha had passed and the request never left the browser.
  • The generic failure now renders red (danger). Named refusals keep their blue alert ("a refusal is not a malfunction").
  • Its sentence depends on whether anything answered (unansweredKey in RegistrationForm.tsx):
    • No HTTP response (offline, SahajCloud unreachable, a rejected preflight): the request never reached the captcha check. The form says common.errors.offline or common.errors.server, chosen by classifyError.
    • An uncoded response: the token may have been spent, so the form keeps "wait for the check, then register again".
    • It uses existing copy only, so SahajCloud's translations need no change.
  • The report form already splits this way (danger plus send_failed) and is unchanged.
  • New smoke case (boot-origins.smoke.test.ts): it replays the widget's own preflight against the SahajCloud origin the bundle names, and fails unless x-turnstile-token is allowed. A preflight writes nothing, so it is safe against production from any preview. The spec count goes from 18 to 19 in production-smoke.yml and docs/testing.md.

⚠ Merge order: the new smoke case is red until sydevs/SahajCloud#1085 is deployed, because every preview's bundle points at production SahajCloud. Merge #1085 first, then re-run this PR's smoke job.

Refs #259 (criterion 4: a test sign-up and report from the live site).

Test results

  • RegistrationForm.submit.test.tsx: three new assertions, the generic failure in danger and no-response copy for online and offline. All three failed against the old form and pass with the fix. Existing refusal cases now also assert they are not danger. RegistrationForm specs: 20 passed.
  • Smoke against production (PREVIEW_URL=https://sahajatlas.com): the new case fails, as it should until #1085 deploys: https://cloud.sydevelopers.com allow-list: origin, x-requested-with, content-type, accept, authorization, content-encoding, x-apollo-tracing, x-payload-http-method-override, x-sahajcloud-preview-secret: expected … to contain 'x-turnstile-token'.
  • Lean gate .claude/skills/pr-prep/check.sh passes: lint, typecheck, 1,901 unit tests.

Manual verification

  1. After #1085 deploys: register for a class on sahajatlas.com. It should reach the confirmation screen.
  2. In devtools, block requests to cloud.sydevelopers.com and register again. The alert should be red and say "Our servers are having trouble right now.", not the security-check sentence.

🤖 Generated with Claude Code

…g answered

Every atlas registration failed in production because SahajCloud's CORS
preflight did not allow `x-turnstile-token` (fixed in sydevs/SahajCloud#1085).
The browser dropped the POST unsent, and the form told the visitor "the
security check needs doing again" — advice that could not help, since the
captcha had passed — in the brand blue a refusal uses rather than the
error colour.

The generic failure now renders as `danger`. Its sentence follows whether
anything answered: a request that got no HTTP response (offline, SahajCloud
unreachable, a rejected preflight) never reached the captcha check, so it
says `common.errors.offline` or `common.errors.server` by `classifyError`;
an uncoded response may have spent the token, so it keeps the "wait for the
check, then register again" sentence. Named refusals keep their blue alert.
The report form already split this way and needs no change.

A smoke case replays the widget's own preflight against the SahajCloud
origin the bundle names, so the cross-repo contract fails a lane rather
than every visitor. It is red against production until #1085 deploys.

Refs #259

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 5, 2026
@sydevs-bot

sydevs-bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
CI fix 1

recent dispatches
  • 23:13Z fix-ci · attempt 1 · session · done
  • 23:13Z fix-ci · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 5, 2026
@cloudflare-workers-and-pages

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 Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 8f8eb7f Nov 05 2026, 11:12 PM

@sydevs-bot

Copy link
Copy Markdown
Contributor

Smoke is red on the one case this PR predicts, and the cause is outside this repo.

tests/smoke/boot-origins.smoke.test.ts → "SahajCloud lets the browser send the captcha token header" fails. I replayed the preflight against production just now:

OPTIONS https://cloud.sydevelopers.com/api/user-submissions → 200
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept,
Authorization, Content-Encoding, x-apollo-tracing,
X-Payload-HTTP-Method-Override, x-sahajcloud-preview-secret

No x-turnstile-token. sydevs/SahajCloud#1085 is open, not merged, so the allow-list has not changed. Every other smoke spec passes, 17 of 18.

I pushed nothing. The spec is correct and asserts the right thing — it stays red until #1085 deploys, which is the merge order the body already states. Weakening or skipping it would delete the lane that caught this.

Re-run Smoke once #1085 is deployed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

…ot 19

CI counted 18, the new preflight case included: the lane was 17 before it,
so the '18' in production-smoke.yml was already one ahead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 5, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 5, 2026
@Ardnived
Ardnived merged commit 2edc587 into main Nov 5, 2026
10 checks passed
@Ardnived
Ardnived deleted the fix/submit-failure-copy branch November 5, 2026 23:25
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 5, 2026
antontcymbal added a commit that referenced this pull request Nov 10, 2026
Brings main's 14 commits (#363-#380) into the combined review build.
Non-obvious resolutions:

- Clock rule (#380): an in-person time names the venue's clock only
  when the viewer's differs, an online time always. Replaces the
  proposals' "every time names its clock". The calendar's TimesNote now
  says main's one sentence (calendar.times_note), only when an online
  class is listed, kept above the grid and the week list; its
  times_city/times_local/times_online keys are gone. Add-a-class Check
  still spells out the inferred clock once, now added there itself.
- Camera padding (#369): the proposals' useClassSheet stays and now
  reports the peek while the sheet is collapsed; main's useSheetCover,
  fitSheet marker and fit-snap rewrite are dropped for the proposals'
  own fit-snap.
- World view (#370): world copies back on with main's minZoom, per its
  Pacific-wrap fix, under the proposals' map controls.
- Place search (#371): the proposals' "search all countries" button
  stays; main's ?cc / browsed-country fallback, per-query release and
  "couldn't find that place" line are ported into it.
- Ancestry (#371): placedPathname/placePathsOf live once, in
  navigation.ts; DrawerStack's stack follows the region tree.
- Deep links to placeless events frame their region (#363), via
  useFrameEventOnTop, which skips contact-only listings.
- Kept proposal designs over main's: registration confirmation,
  Add to calendar list, consent link, GeolocationSuggestion placement,
  filter tags in ListToolbar, map control column. Main's failure copy
  (#365), autofill, by-request type label (#370) and dead-place header
  (#371) are ported in.
- streetAndCity: the proposals' version, now accent-blind as main's is.
- Width pin for the per-edit hook ratcheted 20 -> 21 (both sides added
  one spec).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants