Repository navigation
fix(account): keep a PC that is already in the account bound when Add this PC is pressed again - #4412
Conversation
Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
… absent Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
…itten Co-authored-by: sisyphus-dev-ai <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
|
Merged through omo gate (openai/gpt-6.2-astra) CLEAR at e02b8fc; dori CLEAR at e02b8fc; t13r security-triage YES on access at e02b8fc; required checks green. Merged by relay-hub under the lead's 0.5.9 freeze allow-list. |
…and the account as one line in Settings (#4416) ## What changed The owner asked for adding a PC to read as buttons, not paragraphs (mockups he approved: before/after at http://100.106.153.26:18731/, real captures of this branch at http://100.106.153.26:18731/build/). **Settings → Devices and PCs → Add a connection → Ovis relay** is drawn by state, buttons only: - Signed out: the sign-in buttons alone. GitHub, Google and Apple where the page signs in itself (the desktop app, the PC's own window), each provider's device page where the account service has no link page, and the one **Sign in to Ovis** that opens the link page elsewhere (the link page picks the provider there). - Signed in, this PC in no account: one full-width **Add this PC to my account**. With the relay off it also turns the relay on (the old "Turn on the relay and add this PC"); the device-gate note is its tooltip, and none on a relay that may not start (serve-only). In one press (step 2) it then says **✓ Added**; where one press does not apply (step 2 off, refused), one line names the device to choose Add on, then **Stop waiting**. No digits paragraph, no app.ovis.sh link, no waiting sentence. - Signed in, this PC in the account: **Your account's PCs**, this PC first with a **This PC** pill, then the account's others, one row and at most one button each (**Open**, **Add**). This also holds where step 2 is on (`pc_add_from_account`): signed in to the PC's own account the list shows at once; anyone else still gets "Add from account". - The phone's QR code is a small **Phone QR code** link under them (no sentence). The relay's own switch stays in More settings, and on the tab only while a PC in the account has its relay off. **Settings → Devices and PCs**: - Signed out where the relay tab signs in: no account card (also while the relay's state is still read, so it does not flash in). - Signed in: one line, **Signed in with GitHub** · **Manage account** · **Sign out**, with no account id anywhere. - **Manage account** opens a sheet (`ManageAccountSheet`) with the ways to sign in, the plan and **Delete account** at its foot. While a search runs they are the group's rows, as before. - No ID line under This PC, and no sentence under the page title. Copy in en, ko, ja and zh; strings no longer used are dropped from the dictionaries. DESIGN.md and a changelog fragment are updated. The one-line account follows the ChatGPT and Claude apps (the signed-in account as one row with its sign-out, the rest one level down). ## Also in this PR - **Strict mode** is one row of More settings → Devices and access, **Strict mode (Linux)** with its switch; turning it on asks in a confirmation that names what it ends and what it cannot cover (it was a block of sentences under This PC). No switch where the PC cannot confirm on its screen (P11), on a PC in no account (P12) or off its own window (R10). - **Sign in again from the wait** (owner-approved): when the account service refuses the one press for the sign-in itself, the wait offers **Sign in again** once, where the page signs in its own way (desktop app, the PC's own window). The fresh same-provider sign-in is kept only for the same account and only while the wait runs; the press is made again for the wait's own PC with exactly that sign-in. docs/account.md "Sign in again from the wait". - relay-hub's hosted Sign out (`fix/hosted-signout-visible`: `AccountHead`, `useHostedSignIn`, More's Sign out on a phone), which has no PR of its own, folded into the one-line account and reviewed here. Based on main `f475c0b96` (#4377 and #4412 merged); the Add this PC logic is theirs, only what is drawn changed, apart from the sign-in-again path above. ## Docs README.md (Add a computer), docs/guide.md (the relay, ways to sign in, the account's PCs) and docs/account.md (adding a PC, deleting the account) now name the new controls: **Add this PC to my account** on the relay tab, **Phone QR code**, **Manage account**. The README change waits for the owner's word with the rest. ## Validation (head `d9e38524d`) - `bun run check fast`: passed (exit 0). - Unit tests touched and added: `AccountSection.{addThisPc,deleteAccount,signInAddsPc,ownSignIn}` (incl. sign in again: offer, add, no loop, another account, failure, Stop waiting in another view, a replaced session, the address answering for another PC), `ConnectPhoneDialog` (incl. `relayPending`), `RelayAccountPcs`, `RelaySignIn` and its regression file, `StrictModePanel` (row, confirmation, P11/P12/R10), `AccountPcRows`, `addThisPc`, `i18n`. - Browser regressions in `herdr-ci-runner:local` at this head: listed in the comment below once the run ends (`device-security-demo` PASS so far). - Real captures of this head (ko, light, 1280 and 390): http://100.106.153.26:18731/build/ (owner OK). - Reviews: omo gate (two reviewers over five rounds, every reproduced finding fixed; CLEAR at `dd369b05c`, this head under review); dori review rounds' findings fixed (stale stack, docs, Manage account for another account, unreachable Settings detour, relay read failure, Korean particles). UI change: waits for the owner's word before merge. --------- Co-authored-by: sisyphus-dev-ai <[email protected]>
Release 0.5.9, on the owner's word (2026-11-21, relayed by the lead: release once #4377, #4412 and #4416 are merged; he tests on the real release). Step 2 is on by default from this release (#4377), with the Add this PC relist fix (#4412) and the relay tab's buttons and one-line account (#4416). The hosted shell fix for the Android preload failure (#4413) ships as a new app.ovis.sh build (app.ovis.sh is rolled back to 0.5.7's deployment until then). - `package.json` and `herdr-plugin.toml`: 0.5.8 -> 0.5.9. - `REMOTE_BUNDLE_VERSION` 52 -> 53 (`shared/machines.ts`): `server/` and `shared/` changed since `remote-v52`. After this merges, `remote-v53` is tagged on the merge commit and the Remote PC bundles run publishes it before the Release run. Until the Release run is done, nothing touching `server/`, `shared/`, `bun.lock` or `patches/` merges. - `CHANGELOG.md`: `bun scripts/changelog-fold.ts 0.5.9` folded the fragments under 0.5.9 with their PR links. #4412 has no fragment; its Fixed line was added by hand with its link. No `by @login` credits: every PR in the section is the maintainer's. - `release-summaries.json`: 0.5.9 in en, ko, ja and zh: 5 new, 2 improved, 3 fixed. The new lines say what step 2 does for people (sign in once and the account's PCs open from any device; a 10 s check for a new device, usually; a notice with Not me on the older devices; PCs not in an account work as before; how to turn it off with `OVIS_ACCOUNT_OPENS_ALL=0`). Left out of the summary on purpose (they stay in the changelog): the desktop app's built-in browser (off by default), strict mode as one row, and Sign in again in Add this PC's wait. - `telemetry/deployed.json` unchanged: release guards agree. ## Validation - `bun run check fast` on the remote heavy host (hosthatch) at this release commit on main e00f838: every step ok (unit: 22226 pass, 0 fail, 45 skip). - `bun test scripts/changelog-fold.test.ts scripts/release-notes.test.ts server/release-notes.test.ts scripts/release-guards.test.ts`: 60 pass, 0 fail. - `bun scripts/release-guards.ts --base origin/main`: "Release 0.5.9: remote bundle, telemetry Worker and release metadata are in order." - `bun scripts/release-notes.ts 0.5.9` renders the notes (New features 5, Improvements 2, Bug fixes 3). - Earlier on this branch: an app.ovis.sh incident rollback to 0.5.7's Pages deployment 44cabf26; this release replaces it with a new build from release.yml. - Not run: `check full` (the diff is versions, notes and one constant).
What changed
POST /v1/pcs/:server_id/refresh. The refresh preserves the listing and its admission; the dashboard usesinvited_atfor the invitation's countdown.acct_…identifier from the added state. The localized status is the user-facing confirmation.Only an old service that omits the
listing_idfield entirely and answers the refresh request with404 not_founduses the legacy DELETE/PUT fallback. A directory row that carries the field with an unusable value (malformed,null, a number or empty), fresh or stale, is an invalid answer: nothing is refreshed, deleted or written, and the screen shows its existing "could not be listed, Try again" state (a relist retries later). Otherwise the fallback runs, after a fresh/api/account/statusread. Its residual race requires a second add to bind the same PC after that read and before the DELETE arrives. It closes when #57 is in production: the supported refresh path does not delete or recreate the listing, including when the endpoint returns409 listing_changed. An atomic conditional delete for pending listings belongs in theovis-sh/accountadd-completion follow-up, not in this PR.Exported functions and production callers
AccountService.refreshPc→src/lib/account/addThisPc.ts:215(stale invitation).invitationEndsAt→src/lib/account/myPcs.ts:33(fresh invitation classification),src/lib/relay/dashboard.ts:84(attention expiry), andsrc/components/RelayPcTable.tsx:84(row countdown).listThisPcreports local membership and hands the window ID only to its opening caller insrc/components/AccountSection.tsx:436(scheduled/resumed relist) and:541(manual/automatic add). The existingreopenAddWindowreturns the window ID to:387(keep the current wait open).Verification
e6ca1fd3: three expected reds on main, including the unexpected DELETE and PUT; the stale, locally unbound control passed.336c9bc1: five expected reds on109330d6, including two real one-press binds cleared by the next snapshot. The periodic-relist and bound relay-button coverage passed on that head and remains covered.884979af: 306 focused tests passed; repository typecheck passed.bun scripts/check.ts fastpassed in Docker with--init, a privateHOME, and tmpfs: 21,980 passed, 65 skipped, zero failed./home/devswha/.cache/ovis-tmp/relay-hub/trial/relist-captures/(local evidence).884979afwith test-only commit05d10a84. At2f0257db, typecheck, all 348 focused tests, and the offline relay panel and six-digit Add this PC browser scripts passed. Docker--initfast passed with 21,982 tests passed, 65 skipped, and zero failed.9dd00797failed at2f0257dbon both new cases (listing_id: "invalid"andlisting_id: null, each with a structured404 not_foundrefresh). A scratch probe on that head sawPOST …/refresh,DELETE,PUTand a concurrent one-press bind cleared tonull. Fix034cf1ee:parsePckeeps a present but unusable ID asnull(absent stays absent), andlistThisPcrefuses it before any directory write.realRelay()(added in05d10a84) starts a real PC whose herdr status reads placed their 10 s timeouts on the suite's fake timer queue, sogetTimerCount() === 0assertions failed by timing. Under the same load (16 parallel × 2), merge-base main passed 0 failures in 32 runs,2f0257dbfailed 6–14 of 32, andd4a6eab6(the file usesunitHerdrOnly(), as other server-backed unit files do) passed 32 of 32.d4a6eab6: all 350 focused tests passed (the earlier 348 plus the 2 new cases);bun run typecheckandgit diff --checkpassed. Dockerherdr-ci-runner:localwith--init, a privateHOME, tmpfs/tmpand an internal network ranbun scripts/check.ts fast: every step ok, 21,982 passed, 65 skipped, 0 failed. Offline browser scripts in the same image all exited 0: relay-panel regression; dashboard matrix, 67 checks passed; relay shell QA (Add this PC → six digits → approved → Ready; CSP on 32 pages, no violation; no page errors).d4a6eab6): test-only commit0ffd39f3failed atd4a6eab6for a 1-second-old row carryinglisting_id"invalid",17or"": the listing resolved and sent PUT. Fixe02b8fcbmoves the unusable-ID refusal after the bound-membership return and before the invitation-age check, so any row with an unusable ID rejects withinvalid_answerand no directory write. Ate02b8fcb: all 353 focused tests passed (350 plus the 3 new cases);bun run typecheckandgit diff --checkpassed. Docker fast and browser scripts were not rerun this round; CI covers them.