Repository navigation
feat(auth): beta links let one person past the waitlist without knowing their email - #1246
Conversation
…ng their email A prospect's CEO wants someone on their team to try the beta, and nobody knows that person's email, while Clerk's waitlist only admits an invitation to a known address. A beta link is a forwardable address, /join/<secret>, made by the operator for a company's name. The first work email entered keeps the link, and Clerk emails that address an ordinary invitation, whose sign-up proves the mailbox and takes the terms. Create-or-join then marks the link used and starts the company with the link's name, which the person can change. `pnpm beta-links` creates, lists, resends and revokes links against an instance's database. Each change holds the link's row lock through the Clerk call, as company invitations do, so a revoke can't cross a send. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ainly From review: a failed link's page could ask Clerk for an invitation without limit, so it now counts its attempts and stops after five; the operator's resend isn't counted. A claim racing another link for the same address now gets the "already has an invitation" refusal instead of a 503. A link that is no longer open shows its state whatever was submitted. Revoking a link Clerk never confirmed an invitation for reports `unconfirmed`, since a lost reply may have left one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
GPT 6.1 Sol review of e5e457d, and what came of it (fixes in fed988e):
|
Acceptance: PASS with notesChecked Done means
Golden journeys
Evidence Rollback answers: match the diff. The additive Not run
Notes
|
…a link (#1247) ## What changed This adds release 38's What's new entry, written from `1d59c40`. It covers everything merged since release 37's `through` (`dc89c70`), and sets the `patchy` release to `0.38.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | Behind the scenes: Patchy can now give a prospect a link that lets one person on their team skip the waitlist, for someone whose email nobody knows yet | #1246 | There's no announced change: nobody already using Patchy sees anything different, and the link is handed out by Patchy, not something people can turn on. #1245 is release 37's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `354133d` (release 37) to `1d59c40`:** - #1246 is the only change. It adds migration `0034_beta_links`, a new `beta_links` table that nothing earlier reads, plus the `/join/:secret` routes. Release 37 starts with that migration in its ledger and ignores the table. Its `rollback-rehearsal` check passed all four stages, on the same data. Not `one-way`. - Invitations a beta link already sent stay ordinary Clerk invitations after a rollback: their person can still sign up, and lands on create-or-join without the company name filled in. - No new configuration. The operator script reads settings the server already has. - #1204 also uses migration id 34 and must renumber to 35 before it lands; its ledger test will fail until it does. **Rollback line:** If this release misbehaves, roll back to `354133d` (release 37). ## How it was verified - **Tests.** The `packages/core` and `packages/api` suites pass (133 tests), including `whatsNew.test.ts` and `schemas.test.ts`. - **The range.** #1246 had a GPT 6.1 Sol review with every finding fixed or answered in writing, acceptance PASS with notes, and all 18 required checks green on its head before it was squash-merged. - **Deploy state.** The live commit, pinned from `/healthz/deep`, is `354133d` (release 37). The Deploy run updated last succeeded, and none is unfinished. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. Like every release, the `0.38.0` bump tells CLIs and patch repos installed before this deploy to upgrade. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>

What changed
Big prospects ask for "a link to try it", but the person who will actually try Patchy is on the CEO's team, and nobody knows their email. Clerk's waitlist only admits an invitation to a known address. A beta link is a forwardable address,
/join/<secret>, made by the operator for a company's name. The first work email entered keeps the link for good, and Clerk emails that address an ordinary invitation. Its sign-up proves the mailbox and shows the terms checkbox. Create-or-join then marks the link used and starts the company with the link's name, which the person can change. They invite their team from/companyas usual.pnpm beta-links create --for "Acme" [--days 30]prints the link once.listshows each link's state, the email it went to, and its person's company.resend <id>replaces a lost invitation, andrevoke <id>ends a link and withdraws its invitation. Each command takes--json.Look at
The page, in each state (personas instance; the mock picked was B):
Create-or-join after the link, with the link's name filled in:
Serialization. Claim, retry, resend and revoke each lock the link's row (
SELECT … FOR UPDATE) and hold the lock through the Clerk call and the commit, uninterruptibly. This is the patternInvitations.tsuses, so a revoke can't cross a send. The test "holds a revoke until the invitation being sent is stored, then withdraws it" fails if that lock is removed (checked by hand).Design choices (reviewed twice by GPT 6.1 Sol before building):
InvitationNotPendinggainsstate: accepted | revoked, so revoke can say "they already have an account" instead of "withdrawn". Company invitations handle it as before.How it was verified
BetaLinks.test.ts(11 cases, migrated Postgres, recording, failing and slow Clerk layers) covers:packages/auth,packages/companiesand the migration-ledger test pass (324 tests).pnpm typecheckandpnpm lintare clean. Locally,pnpm checkfailed only in the CLI suites, from T3 Code's strayGET /probes, and in the SDK installer suite, because this shell has nonpmon PATH. Neither touches this change.pnpm dev --clerk:resendreplaced the invitation at Clerk.revokewithdrew it, and a second revoke was safe. Revoking a link whose invitation had been accepted reportedaccepted.patchyhq.com, so this extra click doesn't happen there.Release impact
The change adds one table and new routes. Nothing existing changes shape, and no configuration is new: the operator script reads the settings the server already has.
Migration id: this takes
0034_beta_links, and #1204 also takes 34. Whichever lands second renumbers to 35. The ledger test fails until it does.beta_linkstable and its rows, plus any Clerk invitations already sent. The release before ignores the table. A sent invitation still admits its person through Clerk, and they land on create-or-join without the name filled in.Built by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code.