Repository navigation
D611: colleague seat invites reach the colleague - #1329
Merged
Merged
Conversation
The inviter gets the accept link, and an email only when mail is configured. Pending seats keep the link; accepted and revoked seats do not. An admin cannot take a seat. A founder or partner must confirm before their role becomes investor. Co-authored-by: Guillaume Lauzier <guillaumelauzier@users.noreply.github.com>
Co-authored-by: Guillaume Lauzier <guillaumelauzier@users.noreply.github.com>
|
Preview: https://studioos-pr-1329.guillaumelauzier.workers.dev (built from e81b6cf) The pull request's SPA build on a Worker with no bindings: pages and deep links work, |
Contributor
Author
|
S1: Review: fix first. The red CI is not this PR's fault, but three bugs keep the feature from working. The CI failure is a flake in main's tests.
Blocking:
Non-blocking:
Generated by Claude Code |
Midnight UTC equals datetime('now') for the 00:00:00 second, so a >= window still listed that fixture as upcoming. Wait that second out.
Co-authored-by: Guillaume Lauzier <guillaumelauzier@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
An Institutional investor's colleague invite is a link they can pass on, emailed when mail is configured. Accepting it no longer turns an admin into an investor, and a founder or partner must confirm the role change.
Closes #1311
Implementation
POST /api/investor-seats/invitereturnsinvite_linkandemail_sent, never the bare token. Mail uses the same Gmail path as a company invitation, and only when those credentials are set.GET /api/investor-seatsincludesinvite_linkfor the inviter's pending seats and omits it once a seat is accepted or revoked.POST /api/investor-seats/acceptrefuses an admin with409 admin_cannot_take_seat. A founder, a partner, or any other account that is not already an investor gets409 role_change_needs_confirmation, naming the current role, until the body sendsconfirm_role_change: true. An investor accepts as before.The Colleague seats card says "Invite emailed to …" only when the email went out. Otherwise it shows the link. It does not say "Invite sent."
/investor-seats/acceptis not role-gated. Signed out, it sends the person to sign in and back with the token. Signed in, it follows the role rule and shows each refusal.D611 is
documentation/architecture/decisions/D611.md. No migration.Files changed
cloudflare-worker/src/routes/investor_seats.ts— link, email, and the role rule.frontend/src/pages/SettingsPage.jsx— the card's words follow the route.frontend/src/pages/investorSeatCopy.jsx— the emailed-or-copy outcome and the pending link.frontend/src/pages/AcceptInvestorSeatPage.jsx— the accept page.frontend/src/App.jsx—/investor-seats/accept, unguarded.frontend/src/lib/api.js— accept can send the confirmation.cloudflare-worker/test/investor_seats_d611.test.tsandfrontend/test/investor_seats_d611.test.mjs— the new tests.documentation/architecture/decisions/D611.md— the decision.Testing
npm run build, thennpm run test:drift > drift.log 2>&1; echo EXIT=$?— EXIT=0. Frontend 5091 pass, worker 5937 pass, retention 127.docs/is built, never committed (D529).Mutations, each with a non-zero exit and a
not okline, then restored: the admin refusal removed, the emailed sentence replaced with "Invite sent.", and a pending link hidden. All three caught.node scripts/check-decision-ids.mjs— exit 0.The accept page was rendered signed out, as an admin, as a founder, and as an investor. A signed-in browser session was not walked.
Risks
An existing bookmark that expected the raw token in the invite response will not find it; the link is
invite_link. A founder or partner who accepts must confirm. An admin is refused and stays an admin. Rollback is reverting this commit. No migration, no new binding.Dependencies
None. Found by #1165's audit.
Agent
S16 · Cursor
Review requested
A reviewer from another vendor, when one is available.