Skip to content

Clerk status: report a pending Clerk invitation the row does not store (#2183 follow-up) - #2359

Merged
xegea merged 2 commits into
mainfrom
claude/issue-2183-followup-4
Nov 5, 2026
Merged

xegea merged 2 commits into
mainfrom
claude/issue-2183-followup-4

Conversation

@xegea

@xegea xegea commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Related to #2183.

Problem

After "An invitation or account already exists for this email", Clerk Invitation still read None when Clerk held a pending invitation the member row had not stored (and the existing-account lookup hid it).

Change

GET /members/:id/clerk-status now, for an unlinked member with no stored invitation_id, also looks up Clerk's pending invitations by email, independently of whether an account exists. If one is found it reports has_pending_invitation: true / status: 'invited' and stores the invitation id (System) so it is stable. account_exists is unchanged.

Decisions taken

  • An existing account and a pending invitation are reported as two independent facts (the account no longer outranks the invitation on this read).
  • A Clerk lookup failure leaves the stored state untouched.

Tests

Regression tests added in member-invite-conflict.test.ts. Not run locally (dependencies/MySQL unavailable in this session); CI will run them.


Generated by Claude Code

xegea commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Parked: not mergeable until main is fixed.

API shards 1 and 3 fail, as on #2352, #2353, #2354 and #2364. The cause is the two tests that re-run migration 347's backfill (plan-snapshots.test.ts, plan-snapshot-dual-write.test.ts) against a column migration 356 dropped (source_plan_snapshot_id). I confirmed this from the logs of #2364's shard 3. I did not read this PR's own failing logs. Admin, Payment page and CodeQL are green. Once main is fixed, this PR needs a merge of main and a CI re-run.


Generated by Claude Code

@xegea xegea added the needs-human label Nov 4, 2026 — with Claude
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xegea
xegea merged commit 401fb5a into main Nov 5, 2026
4 of 6 checks passed

This branch had an error being deployed

1 failed deployment
dev — 78ae739c Deployed Nov 5, 2026 by xegea via API (shard 1/3) #3541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants