Read the relay's refusal code, not just the HTTP status #36

Merged
paulhitt merged 1 commits from feat/signup-refusal-messages into main 2026-09-02 19:47:05 +00:00
1 Commits
Author SHA1 Message Date
Paul Hitt e5f4397b28 Read the relay's refusal, not just the HTTP status
🔴 **A 409 is not always a taken handle, and this said it was.** The relay
answers 409 for a taken handle, an already-registered email, AND — since
flamenet-relay!11 — a handle too close to an existing one. Three problems
with three different fixes, all reported as "that handle is already
taken".

Somebody whose EMAIL was already registered was told to pick a different
handle. Doing so cannot work, and nothing anywhere would have told them
why. That is a pre-existing bug, not something the new refusals
introduced; adding a third meaning to 409 is what made it visible.

400 was worse. Every format refusal — a short passphrase, an unusable
email address, a disallowed handle — became "the account service returned
400", which is not a sentence anybody can act on.

The status is the transport's opinion. The `code` in the body is the
relay's, and it has always been sent; nothing here ever read it.

⚠️ **Unknown codes still refuse.** A relay newer than the app is the
normal case, so an unrecognised code falls back to the status rather than
to success — an account the server never created would be a much worse
failure than a vague message.

⚠️ **An unparseable body cannot throw.** A proxy returning HTML on a 409
must still be a refusal, not a crash.

Five tests, proven able to fail: collapsing 409 back to a single meaning
turns four of them red. All three Android suites pass.

Pairs with flamenet-relay!11 and flamenet-messenger-ios!45.
2026-09-01 20:48:11 -04:00