Repository navigation
Conversation
…by its number, and introduce it - A signed-in client offers the account feature in HELLO and pairs a new PC with its account key, asking to join the account so the PC's prompt says so. - Once in a PC that has accounts, a pairing from before the account is linked to the account key with no tap, the PC is listed in the account's directory with its relay key and relay, and an introduction waiting there saves the account's other PCs, each signed in to with the id the add gave this device. - My PCs opens a digit comparison with a listed PC this device is not paired with, only when the directory's key is the one the PC's id comes from, and says which pairings are not in the account yet. - An account member sees a device asking to join through its PC, picks the number that device shows out of three, and on approval signs the add into every other PC's mailbox and leaves the PCs it checked itself as the introduction.
# Conflicts: # src/App.tsx # src/lib/account/account.test.ts # src/lib/account/service.ts # src/lib/i18n/relay.ja.ts # src/lib/i18n/relay.ko.ts # src/lib/i18n/relay.zh.ts # src/lib/relay/channel.ts # src/lib/relay/device.ts # src/lib/useMachineRoster.ts
…s key from the request
Deploying ovis with
|
| Latest commit: |
476bcf9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://230cec31.ovis.pages.dev |
| Branch Preview URL: | https://feat-account-join.ovis.pages.dev |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…oin only once the PC let it in From the reviews of the join PR: - An approver adds a device to the account only when the account service itself saw a device of this account ring at that PC with that key in the last 10 minutes (GET /v1/admissions); a PC that shows another key is declined and the approver is told it could not be verified. A request for that PC only is answered there and never added to the account. - The approver hands the PC the introduction first, retrying until the new device's row exists, and only then leaves the add in the other PCs' mailboxes. - A device that just paired takes the account's steps over a connection of its own, signed in, since the PC refuses a link from the session that paired; it looks for its introduction for a minute. - A device rings through the account service before it compares digits with a PC of the account (POST /v1/admissions). - A PC of another account is not listed in this account's directory, a pairing counts as in the account only when the account lists the PC, a link swaps the key only for the pairing it was signed for, and an introduction is kept to 32 PCs on the PC's own relay. - The chat card's Deny keeps its words.
Review findings and how they were resolved (4134998)Reviews at 24bfdaa: omo BLOCK (one HIGH, reproduced) and Codex (gpt-6.1-terra, xhigh, adversarial: one HIGH, six MEDIUM). Fixed in 4134998, with tests:
Validation at 4134998: |
…rst pairing, so this device can approve
# Conflicts: # src/lib/useMachineRoster.ts
…wait for a PC that has not added this device yet, and ring before an account comparison from any link
Second review round (869551f)omo at 89c20f7: BLOCK (one HIGH, four MEDIUM). Resolution:
Validation at 869551f: |
Third review round (1aef6f3)omo at aa05f2c found no HIGH. Fixed here: a pairing counts as in the account (My PCs, leave, disconnect) only once its PC confirmed it a member (a link it applied, or its account status listing the row), not because it holds the account key. Reproduced MEDIUMs left for a follow-up, per the one-extra-round rule: #2878 (an approval failing after the PC let the device in reaches only that PC; approving while signed out). LOWs noted there too. Validation: |
# Conflicts: # src/components/RelayShell.tsx # src/lib/relay/shell.tsx
Also takes the PC's answer to HELLO after a provisional WELCOME (same nonce), as a PC that selects the account feature sends one.
|
Landed as part of #2867 (the whole account stack was merged there in one squash). |
Stacked on #2846 (account key, sign-in, My PCs).
What
Joining the account from a client, approving a new device from one already in it, and moving existing QR pairings into the account (docs/account.md, "Account members", "Who may admit a device", "Introductions").
shared/relay-channel.ts,shared/relay-device.ts): a client offersaccountinHELLOand keeps what the PC selected (server.features), so an older PC can be told apart. Signed in, a new pairing uses the account key and offerspair-intent-account, so the PC's prompt says what is being approved.src/lib/account/join.ts,shell.tsx): once in a PC that has accounts, a pairing from before the account is linked to the account key over its own session (POST /api/account/link), with no tap. My PCs says Ready · not in the account yet for a pairing that is not linked yet, since removing the device through the account would not reach it.PUT /v1/pcs).AccountApprovals.tsx,AccountApprovalPrompt.tsx): an account member sees a device asking to join through the PC it is in (remote-pairings), picks the number that device shows out of three, and approves or denies. After approving it signs theaddfor the new device into every other PC's mailbox (POST /v1/records) and hands the PC the PCs it checked itself as the new device's introduction (POST /api/account/introduce).GET /api/account/introduction), checks each PC's id against its key, and saves each to sign in with its account key and the id theaddgave it there.src/lib/koreanParticle.ts).Design
The approval sheet follows Microsoft Authenticator's number matching for the pick and Apple's "approve on another device" for what it shows: the device's name, the PC the request came through, how many PCs it joins, three large numbers split 3+3, Deny and Approve (Approve stays off until a number is picked). DESIGN.md's relay shell entry covers the sheet.
Tests
src/lib/account/join.test.ts, against real servers (createServer, mkdtemp state, port 0, realRelaySessionand Noise) and the in-repo fake account service:addwaits in an offline PC's mailbox, the PC collects it on reconnect, and the new device signs in there from the introduction alone.src/lib/relay/channel.test.ts: the account feature offered and recorded.src/lib/account/account.test.ts: a directory key that is not the PC's opens no comparison.src/lib/koreanParticle.test.ts.Validation
bun run check fastat 24bfdaa: ok (typecheck, build, unit tests)./api/devices, coming in the contract below; they land with the account devices screen.