You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(relay): a press opens a PC new in the account through the account key - #4531
For the 24 hours after a PC joins the account in one press (new_until on its directory entry), a device of the account that is not paired with it now gets in on the person's press the same way it gets into any other PC of the account. The press on that PC's join sheet (Ask to join, on the PC's own page, where a tap on its row in My PCs also leads) first signs in with this device's registered account key. Only when that is refused or cannot be tried does the same press send the join request it sends today, with no second press.
The decision behind it, in plain words: a press is enough. During the 24 hours nothing opens the new PC without that press: its page load still puts up the sheet first, a launch still never opens it (it puts up the sheet, or asks to join it, below), and a reload never opens it by itself. The New PC mark, the I didn't add this notice and every other 24-hour behaviour (nothing in the app is selected by itself on that PC) stay as they are.
Why
Before this, nothing ever used the account key for such a PC. Its page skipped the account sign-in for a new PC (openUnpaired: !isNewAccountPc(...)), and the sheet's press only ever sent a join request (PAIR with intent account). On a PC with no paired member, that join is a first join, which only the PC's own window can Allow. So a PC with no screen added by ovis add (#4514), by the Mac app's add over SSH, or by one press could not be opened by any device for 24 hours. Yet the PC had already admitted the account's eligible devices from the account's list, and it answers ok to their account sign-in: server/devices.ts:2263matchAccountRelay → listedAccess → server/account/account-devices.ts:131access(). Nothing on the PC reads new_until, and the only hold is the usual 10-second join hold that the client already waits out. On a PC with a screen, the phone said "press Allow on the PC" while the PC already listed that phone as "Through your account".
The condition, before and after
Before:
Page load (openUnpaired): the account sign-in when join && accountOpen && openKey !== null && !isNewAccountPc(pc) && !launchJoinFor(pc), otherwise the join sheet.
Sheet press (confirmed → pair()): always the join request.
After:
Launch with nothing saved to open (showFront, shell.tsx:507): when the account's PC it picks is inside its 24 hours and this device may sign in to it by the account key (the same accountOpenOf guards), it puts up that PC's sheet and asks nothing: no keepConfirmedPc, no launch card. One press there opens it by the account key. A new PC without that way in, and any PC that is not new, keep the launch's join asked at once, as before.
Page load: unchanged. It uses the same condition, now built by accountOpenOf(pc) plus !isNewAccountPc(pc) (src/lib/relay/shell.tsx:1266).
Sheet press (src/lib/relay/shell.tsx:1064, pressedAccountOpen): the account sign-in, marked pressed, when the account's row for this PC is inside its 24 hours (isNewAccountPc, an unreadable window included) and join && accountOpen && openKey !== null && !launchJoinFor(pc) hold. Those are the same guards a load uses. In every other case it sends the join request as before: every PC that is not new, a fresh never-seen PC (the "new" sheet), a new PC with no key registered here, and a page whose read of the account failed or was not answered.
The sheet starts a fresh read of the account's PCs as it comes up (arrived(), unchanged), and that read blanks the rows until it is back. A press made during it now waits for it (shell.tsx:1066, the existing readAgain, bounded by ACCOUNT_READ_WAIT_MS) before choosing, so a quick tap on a new PC is not sent as a join only because its row was not back yet. For a PC that is not new, a press in that window gets the same join as before, at most that long later.
A refusal of the pressed sign-in goes through the existing handling in failed():
not_listed gets one retry, then the join. admission and a PC without the account's way in (AccountOpenUnsupportedError) get the join. held waits and retries (JoinWait), and a frozen hold waits. All of this is unchanged from a load.
New for pressed only, in the existing "pair" step: keepConfirmedPc before the existing joinPc fallback (shell.tsx:699). The sheet that follows then sends the join at once. This is the same one-navigation consent that a launch's join and a typed-code match already use, so the person is not asked to press twice.
New for pressed only (shell.tsx:690): auth_failed goes to that same "pair" step. A PC answers a key it does not list (not eligible, the account service's own rule for a new sign-in method, removed) with a bare auth_failed, not not_listed: server/devices.ts:2267 returns null for a missing row, and server/relay/session.ts:433/:715 close with auth_failed. server/account/one-press.contract.test.ts checks this for a "stranger" key. Without this mapping the existing handling would show "removed" and mark the PC removed on this device (src/lib/relay/shellState.ts:185 → revoked → markRemovedPc). That would be a regression from today's join for exactly the device that is not on the PC's list.
Any other failure (the PC off, the relay unreachable, account_unreachable, account_readd_required, auth_revoked) shows its failure screen. Its Try again tries the account way again, as after a load.
Every caller changed
src/lib/relay/shell.tsxconfirmed(), the sheet's onPair: pressedAccountOpen, otherwise pair() as before, after the account read the sheet started when one is still running.
src/lib/relay/shell.tsxshowFront, the account launch: the branch above, for a new PC with the account way in.
src/lib/relay/shell.tsxopenUnpaired: the same condition, moved into accountOpenOf (no behaviour change); its comment now says what really happens.
src/lib/relay/shell.tsxfailed(): the two pressed-only additions above.
src/lib/relay/shellState.ts: Attempt.pressed.
Not changed: accountOpenablePcs in pcPick.ts (a launch still never opens a new PC), accountLaunchPcs and its order, arrived(), the sheet component and its words, the New PC notices, and the in-app hold of a new PC (enterApp → setPcNewness).
Why this is no weaker than today
The join request this replaces on a press is approved by the new PC itself: on a first join only its own window can approve, and on a PC with members a member or the PC can. A PC someone else slipped into the account would simply approve it. The join only adds friction for honest PCs: the person walks to a PC with a screen, and a PC with no screen cannot be opened at all. What protects the person is unchanged: nothing opens the new PC without their press (page load, reload and launch are each covered by a test), the New PC mark, and I didn't add this, which removes the listing. The PC checks that listing with the account service before it grants a new account-only session (docs/account.md, "In one press"), so after a removal the account way is refused within a minute.
What this lets in: only a device of the same account whose key that PC already admitted from the account's list. The PC's account rows are per account, so no device of another account gets in. No device that the PC's own checks refuse gets in either: a hold makes the device wait, and freezes, removal evidence and tombstones leave its row out (accountRowStale), so it gets auth_failed and then the same join it would have got before.
One correction to the reasoning as first stated: the join does not add friction "only on PCs with no screen". It adds a walk to every honest PC with a screen too. On a PC with no screen it blocks the person completely.
A removed device, and one fallback per press
A device the PC really removed is not turned into a silent re-join. Its account sign-in gets auth_failed, because its row is left out (accountRowStale: tombstones, removal evidence, freezes). The fallback then sends only the join request the press sent before this change, and the PC judges it as any other join. A key the account removed is refused whoever approves it (server/devices.ts:983, admissionAllowed → removedByAccount). A key the PC revoked is refused for any member's approval (server/devices.ts:984 and :2725), and it comes back only when a person approves it on the PC's own window with the digits, as before. Nothing on this device changes the removed mark: it stays until the PC actually lets the device in.
The fallback happens once per press, never in a loop. The flow is account sign-in, then auth_failed, then one join request, which the PC turns down; after that nothing tries the account way or the join again by itself. The one-navigation mark that sends the join is taken by that join's own page. A reload sends nothing and asks for the press again. Try again on the join's failure screen is a new press, and it sends the join again (the attempt it retries), as before.
Pinned by a device its new PC removed gets only the join a press sent before, once … in shellAccountOpen.test.tsx. The test runs on the same document, as in a browser. The account way gets auth_failed, then one join goes up for approval and the PC declines it. After 30 minutes of fake time there are exactly two attempts (account, join), one approval prompt, no app, the removed mark is still there, and a reload sends nothing. A mutation that makes the join's page try the account way again fails this test.
What is still refused
A launch never signs in to a new PC by the account key. It puts up the sheet, which waits for the press (or, with no account way in, asks to join, as before).
A load or a reload of a new PC's page never signs in. It puts up the sheet.
With no key registered here, or a PC that does not list the key, no longer admits it, or predates the account way in, the press sends the join, which the PC decides as today.
The account service's own 24-hour rule for a new sign-in method stays. Such a device is not on the PC's list and gets the join.
Words on screen
Unchanged. The sheet keeps Add this device to {name} with Ask to join, and those words fit both outcomes: the press asks, and a PC that already let this device in through the account answers at once and opens. Otherwise the existing Approve it on {name} screen with the number follows. While the account sign-in runs, the sheet shows its connecting step, whose first line already reads "Ask to join: Through your account, with this device's key". The sheet does not say, today or after this change, when or by which sign-in the PC was added; the in-app notice with I didn't add this does. No screenshots, since nothing drawn changed.
Validation
Red first, in src/lib/relay/shellAccountOpen.test.tsx: 9 new or changed tests failed on main's code and pass now. They cover: a new PC's page load and reload open nothing, and its press tries the account key and opens on ok; not_listed (twice), admission, auth_failed (direct and over the wire) and a PC without the way in each send the join with no second press and mark nothing removed; a hold is waited out and then the PC opens. Three more pin behaviour that stays, and passed before and after: a launch's join card for a new PC asks by a join only; with no registered key the press sends the join; a PC past its 24 hours whose sign-in was refused at load keeps the press as the join alone. Added after the review: the three tests named under Review (LOW 1, LOW 2, LOW 3), each checked against a mutation that breaks it. Added before it: the removed-device / once-per-press test above, and a press made while the sheet's read of the account's PCs is still out (it waits, then signs in by the account key). Each of these two was checked against a mutation that breaks it (the join's page trying the account way again; no wait for the read): both fail. Those tests drive the same document the way a browser does, with a fragment change on the page that put the sheet up (land). The A3 test still loads the sheet as a fresh page.
dori heavy newpc -- bun run check fast: green on the final tree (typecheck, build, 24404 unit tests), as on each earlier push.
bun test on src/lib/relay/shell*.test.*, src/components/RelayShell.test.tsx and src/components/AddPcSheet.test.tsx: green.
Browser, in the CI runner image (herdr-ci-runner:local, from a git bundle of this branch): relay-second-device-join-regression.ts (drives the join sheet from a PC's own page), relay-first-link-regression.ts and relay-shell-browser-qa.ts (press the confirm and the new-PC sheet) pass on the final source, as on each earlier push. None of them drives a PC inside its 24 hours, and no browser script does.
Skipped: the integration suite and native Windows (no server, shared or Windows code changed), and screenshots (no words changed).
Review
An independent review found no HIGH. Each finding and how it was resolved:
MEDIUM: a press made during the account read that the sheet starts found no row and sent the old join. Fixed in 9937f28, which the reviewer read and agreed with: the press waits for that read (the existing readAgain, bounded). Pinned by "a press made while the sheet's page still reads the account's PCs waits for them …"; a mutation without the wait fails it.
LOW 1: the attempt.pressed === true && guard on the auth_failed mapping (shell.tsx:690) had no test. Mapping every account sign-in's auth_failed to the join passed every shell test. Added "a PC past its 24 hours that answers its page's account sign-in with auth_failed says this device was removed, as before …": a load's sign-in ends on revoked with the removed mark and no join. The same mutation fails it now.
LOW 2: after a successful open, enrolled (shell.tsx:875) drops pressed, which was unpinned. With pressed kept, a later auth_failed on the open session would quietly go to a join instead of "removed". Added "a new PC opened by the press that later ends its session with auth_failed says this device was removed …": revoked, the removed mark, no join. Keeping pressed in enrolled fails it.
LOW 3: after a press opened a new PC with no screen, rememberPc (shell.tsx:924) made it the PC opened last. accountLaunchPcs then asked it first, and when nothing else could be opened, every launch during its 24 hours sent a first join by itself that only the PC's own window could allow. Fixed here: for a new PC with the account way in and a key here, a launch puts up its sheet and sends nothing, so one press opens it by the account key. A new PC without that way in keeps the launch's join. Pinned by "puts up the sheet of a new PC this device may sign in to by the account's key and asks it nothing; one press there opens it by that key" in shell.test.tsx. That test checks: the launch sends nothing and leaves no confirmed or launch-card mark, the PC's page shows the sheet and sends nothing, and the press opens it by the account key. Making the launch ask the join again fails it. "A launch never opens a new PC by itself" stays pinned by the existing "C3: a launch never opens an account-only PC when it is inside its new window / its new window does not parse". The existing "Keep a pane's Codex conversation while tool output fills the screen #16: asks to join a PC new in the account after a sign-in too, at once" still passes for a sign-in with no registered key.
LOW 4: known limit, below.
Known limits
When the PC runs a newer Ovis than the shell, the first open of a pressed sign-in reloads the page once (src/lib/relay/updateFlow.ts:130, reloadOnce). The reloaded page is the new PC's own page, which puts the sheet up again, so the person presses twice. The second press opens it, since the reload happens once per version.
For a PC that is not new, an account sign-in made by its page load and refused with auth_failed (a key the PC does not list) still shows "removed" and marks the PC removed, as before this change. Only the pressed sign-in maps it to the join. That is left for its own change.
When the account way is refused on a new PC with no screen and no member, the join that follows is still a first join that only the PC's own window (or ovis approve, another PR) can allow.
… key
For 24 hours after a one-press admission (the PC's new_until), a device of
the account never signed in to that PC with the account key: the press on
the PC's join sheet always sent a join request, which on a PC with no paired
member is a first join that only the PC's own window can allow. A PC added by
`ovis add`, by the Mac app's add over SSH or by one press, with no screen,
could not be opened by anyone for a day, although it had already admitted the
account's eligible devices from the account's list.
The press on that sheet now signs in with the account key first, under the
same guards a load uses for a PC past its 24 hours (a verified join route, a
key registered here, no launch's join card). A refusal (not_listed after its
one retry, admission, a PC without the way in, or auth_failed for a key the PC
does not list) goes on to the join request that press asked for, with no
second press; a hold is waited out as for any account sign-in. Nothing opens a
new PC without the press: its page load, a reload and a launch behave as
before, and the New PC mark and its remove notice stay.
Co-Authored-By: Claude Opus <[email protected]>
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
For a PC added to your account within the past 24 hours, opening its page or launch card now shows a join sheet instead of opening it automatically.
When you press Ask to join, the app first tries to sign in using the device’s registered key. If that can’t be tried or is refused, it requests approval from the PC without requiring another press.
The New PC mark and I didn’t add this option remain available.
For PCs added within 24 hours, opening still requires a press. Pressing Ask to join first attempts sign-in with the device’s registered account key when eligible, then continues to pairing after supported refusals. Tests and documentation cover launch, reload, and fallback behavior.
Changes: New-PC account-key opening
Layer / File(s)
Summary
New-PC routing and account-open eligibility src/lib/relay/shell.tsx, src/lib/relay/shellAccountOpen.test.tsx, docs/account.md, docs/guide.md, changelog.d/new-pc-opens-on-press.md
The shell checks account-row and launch-card state before selecting account-key opening. A new PC’s own page continues to show the join sheet. Tests and documentation cover launch and reload behavior.
Pressed sign-in and pairing fallback src/lib/relay/shell.tsx, src/lib/relay/shellState.ts, src/lib/relay/shellAccountOpen.test.tsx
A pressed join attempts account-key sign-in when available. Supported refusals continue to pairing without another press. Tests cover refusal cases, holds, and missing keys.
devswha/ovis#4347: Defines the one-press add flow and 24-hour New PC behavior that this change extends.
Merge Risk: Minimal · previous review 68ede
Pressing Ask to join on a new PC now tries the device's account key first and falls back to the join request on the same press. Page load, reload and launch still never open the PC without a press. No concrete defect remains in the supplied evidence, so this is ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the primary change: a press on a new PC in the account opens it through the account key. The changeset implements this in shell.tsx, shellState.ts, and the docs. The 'fix(relay)' prefi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template with both required sections: "Change" and "Validation". The Change section explains the problem, the new behavior, the before/after conditions, and the …
Full details: Title check
Explanation
The title names the primary change: a press on a new PC in the account opens it through the account key. The changeset implements this in shell.tsx, shellState.ts, and the docs. The 'fix(relay)' prefix matches the relay code changes.
Full details: Description check
Explanation
The description follows the repository template with both required sections: "Change" and "Validation". The Change section explains the problem, the new behavior, the before/after conditions, and the decisions behind them. The Validation section lists the checks run (dori heavy newpc -- bun run check fast, bun test on the relay shell tests, and browser scripts), the test results, and the checks skipped (integration suite, native Windows, screenshots). The author links no issue in the Change section, although the template asks for one when a maintainer agreed to a feature. This PR changes a behavior that already exists, so the omission is minor. The description is long and detailed, but it is specific and on-topic.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 08d4578 and 68ede1c.
Files selected for processing: 6
changelog.d/new-pc-opens-on-press.md
docs/account.md
docs/guide.md
src/lib/relay/shell.tsx
src/lib/relay/shellAccountOpen.test.tsx
src/lib/relay/shellState.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
… fallback per press
A press on a new PC's join sheet made while the read of the account's PCs
that the sheet starts is still out found no row and sent the join: it now
waits for that read (the existing readAgain, bounded) before choosing, so a
quick tap still signs in by the account key first.
Tests now drive the sheet on the same document, as a browser does, and pin
the review's two points: a device its new PC removed gets only the join a
press sent before (auth_failed, then one join that the PC judges and turns
down, its removed mark kept), and the fallback happens once per press:
nothing tries the account way or the join again by itself.
Co-Authored-By: Claude Opus <[email protected]>
…y open it
A launch with nothing saved to open picked the account's PC opened last and
asked it to join by itself. After a press had opened a new PC with no screen,
that PC was the one opened last, so every launch during its 24 hours sent a
first join that only the PC's own window can allow. For a new PC this device
may sign in to by the account's key, the launch now puts up its sheet and asks
nothing: one press opens it by that key, and nothing opens it without the
press. A new PC with no account way in keeps the launch's join, as before.
Tests pin what review found unpinned: an account sign-in made by a load that
gets auth_failed still says removed (only a pressed one goes on to the join),
and an opened new PC whose session ends with auth_failed says removed too.
Co-Authored-By: Claude Opus <[email protected]>
Merged through pr-merge at head 08630e9a3. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.
Found by the r14 device pass and the investigation after it: for 24 hours after a PC is added to an account in one press, devices of the account never used the account key for it, even on a press; the press sent a join request that only the PC's own window can allow, so a PC with no screen (added by ovis add or over SSH) could not be opened by anyone for a day, on any account. Now the press on that PC's sheet signs in with the account key first, with the same guards a page load uses for an older PC, and falls back to the join request once when refused; a launch that picks such a PC shows its sheet and sends nothing. Nothing opens a new PC without a press (load, reload, launch unchanged in that), which is what the earlier security condition for this window asks ("no select/open without a tap"); the New PC mark and the remove card stay. Who gets in: only a device of the same account whose key the PC already admitted from the account's list; the PC side is untouched. Independent review by an Opus reviewer agent (no Codex review: its usage limit lasts until 2026-11-28): no HIGH; one MEDIUM (a press during the sheet's account read sent the old join) fixed; test gaps closed; the launch dead end fixed; closure check passed including the new launch branch (mutations of each guard fail tests). A removed device gets only the join a press sent before, once; the PC's own rules refuse a removed key. Known limit: when the PC is newer than the shell the first open reloads once and the person presses twice. Not run on a device; the next preview build covers it.
Merged without a CodeRabbit review of the final head (08630e9): CodeRabbit skipped it. An independent reviewer agent reviewed the change and re-checked the rework, including the new launch branch (Review section in the PR body).
…ts six digits (#4532)
## What and why
A PC with no screen could not be used right after `ovis add`. The press
path ends with "Added. Open <name> from My PCs.", but the PC has no
account member yet. So the first device that opens it sends a **first
join**: six digits that only the PC's own window may accept
(`server/relay/session.ts` `accountJoin` returns `"first"` while
`hasAccountApprover()` is false). `ovis approve` skipped any join that
came with digits and then said "No device is waiting to pair." That left
nobody able to let the first device in.
The server already takes a first join from the own window with six typed
digits: `decideTyped` has no first-join check, and `POST /api/relay/join
{id, digits}` reaches it from the terminal, which counts as the own
window (loopback, not forwarded, `x-herdr-machine`). **No server change
was needed.** This PR changes `scripts/plugin*.ts`, their tests, the
docs and one changelog fragment.
## Decisions (the lead's, as implemented)
1. **`ovis approve` handles first joins.** Each one is listed with the
device's name, the account it comes from (the PC's account, short id)
and the time it asked: `Pixel asks to open this PC (from Ovis account
acct_1a2b3c4, asked at 10:02). Type the six digits Pixel shows (one
wrong entry ends this request), or press Enter to skip:`. The typed
digits go to the existing route (`POST /api/relay/join {id, digits}`),
and the PC compares them.
- A wrong number says so. The route's own limit applies: one wrong entry
ends that join. The command then says how to try again: have the device
ask again, then run `ovis approve` again.
- Enter by itself skips the join. It keeps waiting until its own
deadline.
- The terminal never shows the digits, although the route lists them for
the own window's card. Nothing is approved unless the digits are typed
at this terminal.
- Joins that are not first joins behave as before, with the same prompt,
wording and outcomes.
- With no terminal (stdin not a TTY), each first join is listed with
"Run ovis approve in a terminal on this PC and type the six digits
<device> shows.", followed by the existing not-a-terminal line. Nothing
is sent, and the exit code is 1, as before.
- **`--digits` is not added.** Every request `ovis approve` answers
today needs a terminal, and docs/relay.md and docs/account.md both say
that input that is not a terminal approves nothing. A `--digits` flag
would be the first way to approve from a script or an agent. It would
also put the digits in shell history and in `ps`. The existing options
pattern does not make it a natural fit.
2. **`ovis add` goes on after "Added."** at a terminal, meaning both
stdin and stdout are TTYs:
- It shows: `Added. Open <name> from My PCs on your phone. If the phone
shows six digits, type them here (Enter to finish without):`.
- It watches `GET /api/relay/joins`, the same read `ovis approve` uses,
for up to 10 minutes. Each first join is asked about by name, account
and time.
- Typed digits go to `POST /api/relay/join`. On success it says
`<device> is let in; it opens this PC in a moment.` and ends.
- A wrong number says so, and that join ends. When the device asks
again, its new request shows in the same run.
- If a device gets in by itself meanwhile, it says `<device> can open
this PC now: it got in through your account.` with the `ovis approve`
hint, and ends. "By itself" means, in `GET /api/devices` compared with
the snapshot taken before the watch started: a new member row or
`through_account` row, or a known `through_account` row that signs in
during the watch (its `last_seen_at` goes from null or an older day to a
new one, or a live `connection` appears with a new `since`). A session
that ended, or a member's `last_seen_at` moving, does not count.
- The account sign-in ends (after any `putListing`) before "Added." is
printed, so it is not kept during the watch.
- Enter by itself, Ctrl+C, Ctrl+D and the 10 minutes each end the watch
with the hint line below. The exit code is always 0, because the PC is
added.
- A line answers only the question it was typed under, after 1.5 s
(`DWELL_MS`), and the terminal input is discarded as each question first
shows. These are the same rules `askLine` and `asking` follow.
- With `--account` and no terminal it ends after "Added." with one plain
line: `If your phone asks for six digits when you open <name>, run ovis
approve on this PC and type them.` That line also ends the watch, ends
the "relay did not come online in 30 s" case, and covers an Ovis that
answers 404 for `/api/relay/joins`.
3. **Docs.**
- docs/relay.md, "A PC with no screen", now walks through add → open on
the phone → type the digits at the PC's terminal, including the
wrong-digit, Enter and timeout endings and the no-terminal line. The
step-7 paragraph now names first joins too.
- docs/account.md says that `ovis approve` (and `ovis add`) takes a
first join with its digits, and why that is the same authority as the
PC's own window.
- docs/guide.md: the `ovis approve` comment and the `login` paragraph
are updated.
## Who can do what after this
- **Approving a first join from the terminal needs local owner access.**
The request has to reach this PC's local server as its own window:
loopback, not forwarded, and with the access token when one is set.
Those are the same people who can open its own window. With no access
token, that means any local OS account on that machine; the docs already
tell shared machines to set a token.
- **The CLI only approves with typed digits.** It approves a first join
only when the six digits shown on the asking device are typed, and the
server compares them.
- **The asking device needs a fresh admission.** It needs an admission
at most 10 minutes old, from that PC's account, for its exact key
(condition 2 in account.md).
- **No remote party gains anything.** The route answers 403
`own_window_required` to everything else.
**Correction to the brief:** "only with the six digits" holds for the
CLI, not as a server guarantee. The own window, and so anyone with that
same local access, could already approve a first join with a tap and no
digits (`POST /api/relay/join {id, decision: "approve"}`, `decideOwn`).
The CLI deliberately uses the stricter typed-digits route. This PR adds
no new authority: it uses one that already existed, more strictly.
## Review
An independent review of 3c43ca0 found no HIGH. Each finding below was
checked against the code first, then fixed in one push.
- **MEDIUM 1, the watch missed the usual case.** One press reads the
account snapshot before it answers (`server/account/one-press.ts`), so
the phone's `through_account` row is already known when the watch
starts. With #4531 the phone signs in with the account key and no join,
no new row appears, and the terminal kept asking for digits. **Fixed:**
a known `through_account` row now counts as "got in" when it signs in
during the watch. `GET /api/devices` carries two signals for such rows:
`last_seen_at` (the day of its last sign-in here, null before its first;
`server/devices.ts` `joinedAsPaired`) and, to the PC's own window,
`connection.since` while a session is up. The row counts when either one
moves to a new non-null value, and the ending names that device.
- Unit tests: a known row signing in by `connection` and by
`last_seen_at`; and a session that ended plus a member in use, neither
counted.
- New contract test against the real server: the phone is on the
account's list before the press, so the one-press snapshot admits it. It
signs in with its account key once its 10 s join hold is over, and the
watch ends. This test fails without the fix (it times out) and passes
with it.
- **LOW 2, sign-in kept during the watch.** **Fixed:** `linkToAccount`
has one idempotent `signOut` (put a taken listing back first, then sign
out). `addByPress` calls it before "Added.", and `finally` calls it
again as a no-op. The harness asserts that `/v1/signout` came before
"Added.".
- **LOW 3, missing hint.** **Fixed:** the "got in through your account"
ending now ends with the `ovis approve` hint.
- **LOW 4, approval wording.** **Fixed:** an approval now says `<device>
is let in; it opens this PC in a moment.`, in both `ovis approve` and
the `add` watch.
- **LOW 5, prompts did not state the limit.** **Fixed:** both first-join
prompts now say `(one wrong entry ends this request)`.
- **LOW 6, docs assumed every phone shows digits.** **Fixed:**
docs/relay.md and docs/guide.md now say the phone usually opens the PC
at once. They add: "If the phone shows six digits instead…, it does when
this PC does not list that phone from the account yet (for example the
phone whose sign-in created the account, during that sign-in's first
day)". The relay.md walkthrough also names the watch's two signals and
says the sign-in ends as the PC is added. The changelog fragment is
reworded to match.
- Finding (a) from my first report: the reviewer confirmed it is
existing and harmless. A first-join row gets `account` only from the
device's own `POST /api/account/link`, which the contract test's raw
client never sends.
## Validation
- **Red first:** before the fix, 16 of the new or updated tests in
`scripts/plugin-link.test.ts` failed, and the new contract tests failed.
- `bun test scripts/plugin-link.test.ts`: 199 pass. New tests cover:
- `approveJoins` with first joins: name, account and time; no digits
shown; all six approve; wrong digits; Enter skips; account unknown; a
members join beside it; no terminal.
- The `add` watch: approve by typed digits; wrong then retry; Enter; a
line too soon and a line that is not digits; a device that got in
through the account; 10 minutes; Ctrl+C; an Ovis without the route.
- Updated endings of the existing press tests, and the `--account`
no-terminal hint line.
- `bun test scripts/plugin-link.contract.test.ts`: 6 pass, against a
real PC server and the fake account service:
- `ovis add --account` at a terminal: the PC is added in one press; a
phone sends a real first join through the relay (`approve_on: linux`);
the command asks without showing the digits; the typed digits let the
phone in (`AUTH_OK`, key stored).
- `ovis approve` (`approveJoins` against the real routes): Enter leaves
the join waiting; wrong digits end it (`auth_failed`); the same device
asks again and its digits let it in.
- `bun test scripts/plugin.test.ts -t "pair --approve"`: 12 pass. New
tests run the real CLI against a fake PC:
- at a real terminal (`script`): a first join approved with typed
digits, the next skipped with Enter, the screen never showing the
digits;
- wrong digits;
- piped stdin: the listing plus the instruction, nothing sent.
- The existing #28 members-join tests still pass.
- `bun run typecheck`: clean.
- After the review: `scripts/plugin-link.test.ts` 201 pass,
`scripts/plugin-link.contract.test.ts` 7 pass, `scripts/plugin.test.ts
-t "pair --approve"` 12 pass, `scripts/conventions.test.ts` pass, `bun
run typecheck` clean, and `dori heavy approve -- bun run check fast`
green.
- Before the review: `dori heavy approve -- bun run check fast`: green.
The first run caught two fixed sleeps in `scripts/plugin.test.ts`
without a `// fixed wait:` note; they now have one.
- **Skipped:** screenshots (a CLI change with no UI) and browser
regressions (no shared UI component touched). Windows and macOS were not
run locally; the new `script`-based tests skip on Windows like the
existing ones.
## Known limits
- `ovis approve` is one pass over the joins it read. After a wrong
entry, run it again once the device asked again. `ovis add`'s watch
picks up the new request by itself.
- A row of the account's list that already signed in here before the
watch started (same day, no new session) gives no new signal. The watch
then waits until Enter, Ctrl+C or the 10 minutes, and says how to
finish.
- The watch reads `GET /api/relay/joins` and `GET /api/devices` on
loopback every 2 s for at most 10 minutes.
- This PR touches `scripts/plugin*`, so it waits for GitHub's checks and
an independent review.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus <[email protected]>
…s made on (#4540)
## What was wrong
This is a device recheck of main at 6b2d123 (#4531 merged as
cf0b36f), on a fresh account where the phone's key is not on the PC's
list. On the sheet of a PC new in the account, **Ask to join** (참여 요청)
tried the account sign-in, and the PC answered `auth_failed` as
expected. Then the page went to the hosted root and showed My PCs, and
the join request was never sent: no Allow card on the PC, and `GET
/api/relay/joins` stayed empty. So nobody could open such a PC from a
phone.
## Reproduced in a real browser first
The new `scripts/relay-new-pc-press-regression.ts` uses:
- the hosted shell build (`dist-shell/`, routed in for
`https://app.ovis.sh`);
- a real PC (`createServer`) behind a local Bun relay, with the page's
relay sockets bridged to it;
- the in-memory account service, with Step 2 on.
Each case has an account of its own, whose PC was added in one press, so
it is inside `new_until`. The device signs in through the provider flow,
which registers its key, either as not eligible (the PC has no row for
it) or as eligible. It reaches the PC's sheet one of three ways: from
the PC's address, from its row in My PCs, or from the sign-in's launch.
It runs at 390 (touch) and at 1440.
Before the press, each case checks that the sheet waits and that nothing
reached the PC: no join, and no relay connection once the sheet is up.
After the press:
- **Not eligible:** the join must reach the PC's own window (`GET
/api/relay/joins`), and the page must show the number beside the PC's
Allow, still on `/s/<id>/`.
- **Eligible:** the PC must open through the account, with no join.
On main's shell, all three not-eligible cases at 390 fail; every other
case passes, including the same three at 1440. After the press, the URL
went `/s/<id>/` → `/s/<id>/#offer=…` (the fallback's link) → `/s/<id>/`
→ `https://app.ovis.sh/`. The page ended on the empty front page, and no
join reached the PC. An instrumented run logged a `popstate` with
`state=null` on that fragment change, before its `hashchange`.
## Cause (lines on main)
1. `src/lib/relay/shell.tsx:700`: when the pressed account sign-in is
refused, the `"pair"` step of `failed()` asks for the join through
`joinPc(...)`. On the PC's own page, that does `replace(link.pathname +
link.hash)` (`shell.tsx:648`), which is a fragment navigation,
`location.replace("/s/<id>/#offer=…")`.
2. A fragment navigation fires `popstate` (state null) before
`hashchange`.
3. On a phone or touch screen (`BACK_QUERY`), the join sheet holds a
history entry through `usePhoneSheetBack`
(`src/components/AddPcSheet.tsx:99`). The popstate listener in
`src/lib/sheetHistory.ts` (`:528`) takes any popstate off that entry for
Back, and calls the sheet's `onBack` (`:469`).
4. The sheet's `close` (`AddPcSheet.tsx:95`) then runs `onCancel` and
`onClose`. `onClose` is the shell's `onBack`
(`src/components/RelayShell.tsx:389`), which is `toFront`
(`shell.tsx:406-415`): `cancelAttempt(); navigate("/")`, a full load of
the hosted root with the front page chosen. The `hashchange` handler
that would have sent the join (`arrived()` taking the `keepConfirmedPc`
mark) ran on a page that was already leaving.
At 1440 without touch the sheet holds no history entry, so the same flow
worked there. The unit tests of #4531 stood in for the browser with
recorded navigations and a same-document fragment step, without the
sheet's component or its history entry, so they never saw step 3.
The device pass also reported plain Chrome. If that was a desktop-width
window, it is a second failure this script does not reproduce: at 1440
every case passes on main.
## Fix
In `failed()`'s `"pair"` step (`src/lib/relay/shell.tsx:701`), a pressed
attempt whose sheet is the one up (`entry.offer` and `sheetJoin` both
name that PC) now sends its join from that sheet with no navigation:
`show(confirmOf(entry.offer)); pair()`. The `keepConfirmedPc` mark is no
longer used for it. Any other fallback (a load's refused account
sign-in, where no sheet is up) still goes through `joinPc`, as before.
The rules of #4531 still hold:
- **Nothing opens without a press:** no change here; the script checks
that nothing reaches the PC before the press in every case.
- **One fallback per press:** a single `pair()`; the removed-device test
still sees exactly one account sign-in and one join over 30 minutes.
- **A removed device gets only the join:** the same join, judged by the
PC; covered by the same test.
- **A PC that is not new keeps today's handling:** that path is
unchanged and still pinned by its test.
## Tests
- Unit (`src/lib/relay/shellAccountOpen.test.tsx`): the test page now
has a `phoneSheet` model. As the phone's sheet does, a link the page
takes while the join sheet is up runs the sheet's Cancel and Back. These
cases now run under that model and expect the join with no navigation:
- the four refusal cases (`not_listed` twice, `admission`,
`auth_failed`, and a PC without the way in);
- the removed-device / once-per-press case;
- the wire `auth_failed` case.
All 6 fail against main's `shell.tsx` and pass with the fix.
- Browser: `scripts/relay-new-pc-press-regression.ts`, added to
`scripts/ci-browser.sh` after `relay-second-device-join-regression.ts`.
All 12 cases pass with the fix; on main the three not-eligible cases at
390 fail.
- `relay-second-device-join-regression.ts` and
`relay-shell-browser-qa.ts` pass.
## Validation
- `dori heavy newpc2 -- bun run check fast`: green (typecheck, build,
24439 unit tests).
- In the CI runner image (`herdr-ci-runner:local`, through `dori heavy`,
from a git bundle of this branch, `bun run build:shell` then `bun run
check run --build`): `relay-new-pc-press-regression.ts` (12 of 12),
`relay-second-device-join-regression.ts` and `relay-shell-browser-qa.ts`
all pass.
- Skipped: the integration suite and native Windows, since no server,
shared or Windows code changed.
## Known limits
- `sheetHistory.ts` takes any popstate off a sheet's entry for Back,
including a fragment change the page makes itself. This PR keeps the
shell from making one while the join sheet is up, rather than changing
how sheets read history. Any other place that changes the fragment under
an open phone sheet would close that sheet the same way.
- The PC asks the account service about a join at most once in 10
seconds (`server/account/mailbox.ts`, `admitted`). A second device
asking the same PC within that time is refused (`pair-unavailable`) and
asks again with Try again. That was so before, and the script gives each
case a PC of its own.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus <[email protected]>
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
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.
What changed
For the 24 hours after a PC joins the account in one press (
new_untilon its directory entry), a device of the account that is not paired with it now gets in on the person's press the same way it gets into any other PC of the account. The press on that PC's join sheet (Ask to join, on the PC's own page, where a tap on its row in My PCs also leads) first signs in with this device's registered account key. Only when that is refused or cannot be tried does the same press send the join request it sends today, with no second press.The decision behind it, in plain words: a press is enough. During the 24 hours nothing opens the new PC without that press: its page load still puts up the sheet first, a launch still never opens it (it puts up the sheet, or asks to join it, below), and a reload never opens it by itself. The New PC mark, the I didn't add this notice and every other 24-hour behaviour (nothing in the app is selected by itself on that PC) stay as they are.
Why
Before this, nothing ever used the account key for such a PC. Its page skipped the account sign-in for a new PC (
openUnpaired:!isNewAccountPc(...)), and the sheet's press only ever sent a join request (PAIR with intentaccount). On a PC with no paired member, that join is a first join, which only the PC's own window can Allow. So a PC with no screen added byovis add(#4514), by the Mac app's add over SSH, or by one press could not be opened by any device for 24 hours. Yet the PC had already admitted the account's eligible devices from the account's list, and it answers ok to their account sign-in:server/devices.ts:2263matchAccountRelay→listedAccess→server/account/account-devices.ts:131access(). Nothing on the PC readsnew_until, and the only hold is the usual 10-second join hold that the client already waits out. On a PC with a screen, the phone said "press Allow on the PC" while the PC already listed that phone as "Through your account".The condition, before and after
Before:
openUnpaired): the account sign-in whenjoin && accountOpen && openKey !== null && !isNewAccountPc(pc) && !launchJoinFor(pc), otherwise the join sheet.confirmed→pair()): always the join request.After:
showFront,shell.tsx:507): when the account's PC it picks is inside its 24 hours and this device may sign in to it by the account key (the sameaccountOpenOfguards), it puts up that PC's sheet and asks nothing: nokeepConfirmedPc, no launch card. One press there opens it by the account key. A new PC without that way in, and any PC that is not new, keep the launch's join asked at once, as before.accountOpenOf(pc)plus!isNewAccountPc(pc)(src/lib/relay/shell.tsx:1266).src/lib/relay/shell.tsx:1064,pressedAccountOpen): the account sign-in, markedpressed, when the account's row for this PC is inside its 24 hours (isNewAccountPc, an unreadable window included) andjoin && accountOpen && openKey !== null && !launchJoinFor(pc)hold. Those are the same guards a load uses. In every other case it sends the join request as before: every PC that is not new, a fresh never-seen PC (the "new" sheet), a new PC with no key registered here, and a page whose read of the account failed or was not answered.arrived(), unchanged), and that read blanks the rows until it is back. A press made during it now waits for it (shell.tsx:1066, the existingreadAgain, bounded byACCOUNT_READ_WAIT_MS) before choosing, so a quick tap on a new PC is not sent as a join only because its row was not back yet. For a PC that is not new, a press in that window gets the same join as before, at most that long later.failed():not_listedgets one retry, then the join.admissionand a PC without the account's way in (AccountOpenUnsupportedError) get the join.heldwaits and retries (JoinWait), and a frozen hold waits. All of this is unchanged from a load.pressedonly, in the existing "pair" step:keepConfirmedPcbefore the existingjoinPcfallback (shell.tsx:699). The sheet that follows then sends the join at once. This is the same one-navigation consent that a launch's join and a typed-code match already use, so the person is not asked to press twice.pressedonly (shell.tsx:690):auth_failedgoes to that same "pair" step. A PC answers a key it does not list (not eligible, the account service's own rule for a new sign-in method, removed) with a bareauth_failed, notnot_listed:server/devices.ts:2267returns null for a missing row, andserver/relay/session.ts:433/:715close withauth_failed.server/account/one-press.contract.test.tschecks this for a "stranger" key. Without this mapping the existing handling would show "removed" and mark the PC removed on this device (src/lib/relay/shellState.ts:185→revoked→markRemovedPc). That would be a regression from today's join for exactly the device that is not on the PC's list.account_unreachable,account_readd_required,auth_revoked) shows its failure screen. Its Try again tries the account way again, as after a load.Every caller changed
src/lib/relay/shell.tsxconfirmed(), the sheet'sonPair:pressedAccountOpen, otherwisepair()as before, after the account read the sheet started when one is still running.src/lib/relay/shell.tsxshowFront, the account launch: the branch above, for a new PC with the account way in.src/lib/relay/shell.tsxopenUnpaired: the same condition, moved intoaccountOpenOf(no behaviour change); its comment now says what really happens.src/lib/relay/shell.tsxfailed(): the twopressed-only additions above.src/lib/relay/shellState.ts:Attempt.pressed.accountOpenablePcsinpcPick.ts(a launch still never opens a new PC),accountLaunchPcsand its order,arrived(), the sheet component and its words, the New PC notices, and the in-app hold of a new PC (enterApp→setPcNewness).Why this is no weaker than today
The join request this replaces on a press is approved by the new PC itself: on a first join only its own window can approve, and on a PC with members a member or the PC can. A PC someone else slipped into the account would simply approve it. The join only adds friction for honest PCs: the person walks to a PC with a screen, and a PC with no screen cannot be opened at all. What protects the person is unchanged: nothing opens the new PC without their press (page load, reload and launch are each covered by a test), the New PC mark, and I didn't add this, which removes the listing. The PC checks that listing with the account service before it grants a new account-only session (docs/account.md, "In one press"), so after a removal the account way is refused within a minute.
What this lets in: only a device of the same account whose key that PC already admitted from the account's list. The PC's account rows are per account, so no device of another account gets in. No device that the PC's own checks refuse gets in either: a hold makes the device wait, and freezes, removal evidence and tombstones leave its row out (
accountRowStale), so it getsauth_failedand then the same join it would have got before.One correction to the reasoning as first stated: the join does not add friction "only on PCs with no screen". It adds a walk to every honest PC with a screen too. On a PC with no screen it blocks the person completely.
A removed device, and one fallback per press
auth_failed, because its row is left out (accountRowStale: tombstones, removal evidence, freezes). The fallback then sends only the join request the press sent before this change, and the PC judges it as any other join. A key the account removed is refused whoever approves it (server/devices.ts:983,admissionAllowed→removedByAccount). A key the PC revoked is refused for any member's approval (server/devices.ts:984and:2725), and it comes back only when a person approves it on the PC's own window with the digits, as before. Nothing on this device changes the removed mark: it stays until the PC actually lets the device in.auth_failed, then one join request, which the PC turns down; after that nothing tries the account way or the join again by itself. The one-navigation mark that sends the join is taken by that join's own page. A reload sends nothing and asks for the press again. Try again on the join's failure screen is a new press, and it sends the join again (the attempt it retries), as before.a device its new PC removed gets only the join a press sent before, once …inshellAccountOpen.test.tsx. The test runs on the same document, as in a browser. The account way getsauth_failed, then one join goes up for approval and the PC declines it. After 30 minutes of fake time there are exactly two attempts (account, join), one approval prompt, no app, the removed mark is still there, and a reload sends nothing. A mutation that makes the join's page try the account way again fails this test.What is still refused
Words on screen
Unchanged. The sheet keeps Add this device to {name} with Ask to join, and those words fit both outcomes: the press asks, and a PC that already let this device in through the account answers at once and opens. Otherwise the existing Approve it on {name} screen with the number follows. While the account sign-in runs, the sheet shows its connecting step, whose first line already reads "Ask to join: Through your account, with this device's key". The sheet does not say, today or after this change, when or by which sign-in the PC was added; the in-app notice with I didn't add this does. No screenshots, since nothing drawn changed.
Validation
src/lib/relay/shellAccountOpen.test.tsx: 9 new or changed tests failed on main's code and pass now. They cover: a new PC's page load and reload open nothing, and its press tries the account key and opens on ok;not_listed(twice),admission,auth_failed(direct and over the wire) and a PC without the way in each send the join with no second press and mark nothing removed; a hold is waited out and then the PC opens. Three more pin behaviour that stays, and passed before and after: a launch's join card for a new PC asks by a join only; with no registered key the press sends the join; a PC past its 24 hours whose sign-in was refused at load keeps the press as the join alone. Added after the review: the three tests named under Review (LOW 1, LOW 2, LOW 3), each checked against a mutation that breaks it. Added before it: the removed-device / once-per-press test above, and a press made while the sheet's read of the account's PCs is still out (it waits, then signs in by the account key). Each of these two was checked against a mutation that breaks it (the join's page trying the account way again; no wait for the read): both fail. Those tests drive the same document the way a browser does, with a fragment change on the page that put the sheet up (land). The A3 test still loads the sheet as a fresh page.dori heavy newpc -- bun run check fast: green on the final tree (typecheck, build, 24404 unit tests), as on each earlier push.bun testonsrc/lib/relay/shell*.test.*,src/components/RelayShell.test.tsxandsrc/components/AddPcSheet.test.tsx: green.herdr-ci-runner:local, from a git bundle of this branch):relay-second-device-join-regression.ts(drives the join sheet from a PC's own page),relay-first-link-regression.tsandrelay-shell-browser-qa.ts(press the confirm and the new-PC sheet) pass on the final source, as on each earlier push. None of them drives a PC inside its 24 hours, and no browser script does.Review
An independent review found no HIGH. Each finding and how it was resolved:
readAgain, bounded). Pinned by "a press made while the sheet's page still reads the account's PCs waits for them …"; a mutation without the wait fails it.attempt.pressed === true &&guard on theauth_failedmapping (shell.tsx:690) had no test. Mapping every account sign-in'sauth_failedto the join passed every shell test. Added "a PC past its 24 hours that answers its page's account sign-in with auth_failed says this device was removed, as before …": a load's sign-in ends onrevokedwith the removed mark and no join. The same mutation fails it now.enrolled(shell.tsx:875) dropspressed, which was unpinned. Withpressedkept, a laterauth_failedon the open session would quietly go to a join instead of "removed". Added "a new PC opened by the press that later ends its session with auth_failed says this device was removed …":revoked, the removed mark, no join. Keepingpressedinenrolledfails it.rememberPc(shell.tsx:924) made it the PC opened last.accountLaunchPcsthen asked it first, and when nothing else could be opened, every launch during its 24 hours sent a first join by itself that only the PC's own window could allow. Fixed here: for a new PC with the account way in and a key here, a launch puts up its sheet and sends nothing, so one press opens it by the account key. A new PC without that way in keeps the launch's join. Pinned by "puts up the sheet of a new PC this device may sign in to by the account's key and asks it nothing; one press there opens it by that key" inshell.test.tsx. That test checks: the launch sends nothing and leaves no confirmed or launch-card mark, the PC's page shows the sheet and sends nothing, and the press opens it by the account key. Making the launch ask the join again fails it. "A launch never opens a new PC by itself" stays pinned by the existing "C3: a launch never opens an account-only PC when it is inside its new window / its new window does not parse". The existing "Keep a pane's Codex conversation while tool output fills the screen #16: asks to join a PC new in the account after a sign-in too, at once" still passes for a sign-in with no registered key.Known limits
When the PC runs a newer Ovis than the shell, the first open of a pressed sign-in reloads the page once (
src/lib/relay/updateFlow.ts:130,reloadOnce). The reloaded page is the new PC's own page, which puts the sheet up again, so the person presses twice. The second press opens it, since the reload happens once per version.For a PC that is not new, an account sign-in made by its page load and refused with
auth_failed(a key the PC does not list) still shows "removed" and marks the PC removed, as before this change. Only the pressed sign-in maps it to the join. That is left for its own change.When the account way is refused on a new PC with no screen and no member, the join that follows is still a first join that only the PC's own window (or
ovis approve, another PR) can allow.🤖 Generated with Claude Code