Skip to content

feat(errors): register IDENTIFIER_CONFLICT, INVITE_ACCOUNT_EXISTS_UNVERIFIED, ALREADY_AUTHENTICATED_USE_LINK - #1847

Merged
pyramation merged 1 commit into
mainfrom
feat/register-invite-provisioning-errors
Sep 17, 2026
Merged

pyramation merged 1 commit into
mainfrom
feat/register-invite-provisioning-errors

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Registers the three public error codes introduced by constructive-io/constructive-db#3806 so they resolve to user-facing copy and an HTTP status instead of falling through as unknown codes.

code raised by http
IDENTIFIER_CONFLICT provision_<scope>_user when email and phone resolve to different users 409
INVITE_ACCOUNT_EXISTS_UNVERIFIED global-scope provisioning: existing unverified account, no live invite 409
ALREADY_AUTHENTICATED_USE_LINK sign_up / sign_up_sms called by an already-signed-in caller 409
  • scripts/db-error-inventory.json: three entries added by hand rather than a full re-audit — a fresh audit-db-errors.py run against constructive-db main would also drop the STORAGE_* codes (they only exist on the unmerged feat/storage-processing-lifecycle branch) and fail storage-lifecycle.test.ts.
  • src/generated/registry.generated.ts: regenerated from the inventory via generate-registry.py.
  • src/registry.ts: curated overrides with real copy (generated heuristic gave IDENTIFIER_CONFLICT / INVITE_ACCOUNT_EXISTS_UNVERIFIED a 400).

Link to Devin session: https://app.devin.ai/sessions/bb95227949054e6689dc66c815dbb738
Open in Devin Desktop: https://app.devin.ai/desktop/session/bb95227949054e6689dc66c815dbb738?variant=devin
Requested by: @pyramation

…ERIFIED, ALREADY_AUTHENTICATED_USE_LINK

Codes raised by constructive-db#3806 (provisioning identifier resolution,
invitee pending/accept lane, signed-in sign-up guard). Added to the audit
inventory and regenerated registry.generated.ts; curated copy + 409 in
registry.ts.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@tenki-reviewer

tenki-reviewer Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 2 nitpicks below.

🧹 Nitpicks (2) — 🟢 2 low
  • 🟢 Reword INVITE_ACCOUNT_EXISTS_UNVERIFIED user-facing copy (registry.ts:330) — The public INVITE_ACCOUNT_EXISTS_UNVERIFIED error ends with the developer-directed sentence 'Ask the user to verify their account instead.', which reads as integration guidance rather than end-user copy (packages/errors/src/registry.ts:334).
  • 🟢 Generated vs curated HTTP status diverges (registry.ts:124) — IDENTIFIER_CONFLICT and INVITE_ACCOUNT_EXISTS_UNVERIFIED are curated to http: 409 (packages/errors/src/registry.ts:127, :333), but the generating heuristic http_for assigns them 400 (packages/errors/scripts/generate-registry.py:200), so the generated registry.generated.ts view reports 400 for codes the curated registry classifies as 409.

The PR extends the error registry with three curated definitions that override generated entries: ALREADY_AUTHENTICATED_USE_LINK, IDENTIFIER_CONFLICT, and INVITE_ACCOUNT_EXISTS_UNVERIFIED, setting them to class public, giving them tailored client-facing messages, and assigning 409 statuses (two of which move the heuristic default 400 to the conflict code). It also records the class: "public" assignment in db-error-inventory.json.

Files Change
packages/errors/src/registry.ts Adds three curated auth/invite error definitions overriding generated entries with public class, refined copy, and 409 HTTP statuses
packages/errors/scripts/db-error-inventory.json Records the class: "public" override for the three new curated codes

Reviewed commit: 3b72fcf

@pyramation
pyramation merged commit 41de688 into main Sep 17, 2026
21 checks passed
@pyramation
pyramation deleted the feat/register-invite-provisioning-errors branch September 17, 2026 20:32
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