Skip to content

fix(relay): say why the relay tab shows sign-in again for another account - #4882

Merged
devswha merged 2 commits into
mainfrom
fix/other-account-hint
Nov 27, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/other-account-hint

Conversation

@devswha

@devswha devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner

What

Signed in to another Ovis account than the one this PC is in, the relay tab showed the same sign-in buttons again with no word on why, so a finished sign-in looked like it did nothing (seen on a Mac added under GitHub and signed in with Google: each way of signing in is its own account until linked). The tab now keeps the owner #25 layout (sign-in buttons and the phone's QR code, no prompt) and adds one line above the buttons:

  • the PC knows how its owner signed in: "This PC is in another account. Sign in with GitHub."
  • it does not (a PC added by an older Ovis, ovis add): "This PC is in another account. Sign in the way you used when you first added this PC."

HTTP contract (additive only)

  • POST /api/account/relay-account takes an optional provider (github | google | apple). The PC keeps it in relay/account.json beside the account. Any other value counts as none; a naming without one (older apps, ovis add, server-side one-press) keeps the provider said before for the same account, and naming another account drops it.
  • GET /api/account/status adds account_provider while the PC is in the account that naming was for. Older apps ignore it; a new app talking to an older PC gets no field and shows the generic line.
  • The page's "Add this PC" and one-press paths send the stored sign-in's provider. No account service (ovis-sh/account) change.

docs/account.md documents both fields.

Design reference

No other app's screen is followed here: the maintainer's approved mockup keeps the tab as it is and adds one inline line in the tab's existing settings-hint style, the smallest change that says why. The provider buttons stay as they are (no highlight).

Screenshots (light, Korean UI)

Desktop 1280 Phone 390
Before before desktop before phone
After (PC knows the way) after desktop after phone
After (PC does not know) after unknown desktop after unknown phone

Rendered from a fixture of RelayTab against main and this branch with a stubbed PC and account service (no live session).

Tests

  • ConnectPhoneDialog.test.tsx: the owner Open a pane's terminal first, chat on request #25 case now shows the generic line; a new case shows "Sign in with GitHub." for account_provider: "github" and the generic line for an unknown value; the PC's own account shows no line.
  • account.contract.test.ts: relay-account with a provider shows in status; a naming without one, or with an unknown value, keeps it; another provider replaces it.
  • bun run check fast.

…ount, and which way leads to the PC's

A sign-in that lands in another Ovis account than the PC's (a different
provider is a different account) left the relay tab on the same sign-in
buttons with no word on why. The tab now says the PC is in another
account above the buttons, and names GitHub, Google or Apple when the PC
knows how its owner signed in.

The PC learns that from POST /api/account/relay-account, which now takes
an optional provider (kept in relay/account.json; a naming without one
keeps the earlier one for the same account), and GET /api/account/status
says it as account_provider while the PC is in that account. Both fields
are additive: an older app sends none and gets the generic line.
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

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.

Run configuration

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
    • When the signed-in account differs from the account associated with this PC, the relay tab now displays a sign-in notice. When available, it identifies the provider previously used for the PC’s account; otherwise, it asks you to use the original sign-in method.
    • The notice is now available in Japanese, Korean, and Simplified Chinese.

The change records the sign-in provider used to name a relay account, returns that provider in account status, and uses it to guide users when the PC belongs to another account.

Changes: Relay account provider guidance

Layer / File(s) Summary
Provider validation and relay account API
shared/account-devices-api.ts, server/relay/service.ts, server/account/routes.ts, server/account/account.contract.test.ts, docs/account.md
The API validates supported providers and stores them with relay account names. Status includes the saved provider when the current account matches the named account. Tests and API documentation cover provider updates and preservation.
Client provider propagation
src/lib/account/join.ts, src/lib/account/addThisPc.ts
The client includes the session provider when naming the relay account. Account status parsing exposes only supported provider values.
Account-mismatch guidance
src/components/ConnectPhoneDialog.tsx, src/components/ConnectPhoneDialog.test.tsx, src/lib/i18n/devices.*.ts, changelog.d/other-account-hint.md
The relay tab names the provider in its sign-in guidance when known. It uses generic wording when the provider is unavailable or the status read fails. Tests cover the notice and fallback, and the translations and changelog describe the guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

  • devswha/ovis#3270: Adds the relay-account endpoint that this change extends with an optional provider field.
Merge Risk: Minimal · previous review 1f17a

The relay tab now explains when the signed-in account differs from the PC's account, and names the sign-in provider when the PC knows it. The API additions are optional and compatible with older apps and older PCs. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the relay tab now explains why it shows sign-in again when the signed-in account differs from the PC's account. It is specific, uses the conventional fix(relay) prefix…
Description check Passed The description follows the template. The Change section describes the problem (sign-in buttons shown again with no reason) and the resulting behavior, and it explains the HTTP contract. The Validatio…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the relay tab now explains why it shows sign-in again when the signed-in account differs from the PC's account. It is specific, uses the conventional fix(relay) prefix, and matches the objectives and the changeset (ConnectPhoneDialog, relay account provider, and status fields).

Full details: Description check

Explanation

The description follows the template. The Change section describes the problem (sign-in buttons shown again with no reason) and the resulting behavior, and it explains the HTTP contract. The Validation section lists the tests and the bun run check fast command with its result. It does not link an issue for the feature, and the template asks for that link. It also does not state a pass or fail result for the check, and it does not say whether the full check ran. These gaps are minor. The Validation section also lists the test cases, which covers the contract-test requirement for HTTP changes.

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4902ecd and 1f17aa2.

Files selected for processing: 13

  • changelog.d/other-account-hint.md
  • docs/account.md
  • server/account/account.contract.test.ts
  • server/account/routes.ts
  • server/relay/service.ts
  • shared/account-devices-api.ts
  • src/components/ConnectPhoneDialog.test.tsx
  • src/components/ConnectPhoneDialog.tsx
  • src/lib/account/addThisPc.ts
  • src/lib/account/join.ts
  • src/lib/i18n/devices.ja.ts
  • src/lib/i18n/devices.ko.ts
  • src/lib/i18n/devices.zh.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Review round (omo gate + Codex gpt-6.2-sol-fast xhigh, once each; no HIGH from either). Fixed in the follow-up commit:

  • MEDIUM (gate + Codex): the line came from a second status read. The relay tab now takes the account and its sign-in way from the same GET /api/account/status answers AccountQr already reads (onPcStatus), so a known provider shows with the first answer and there is no extra request or stale mix of two reads.
  • LOW (gate + Codex): status read relay/account.json twice. savedRelayNaming() reads the account and provider once.

bun run check fast after the fix: typecheck, build and unit tests (29143 pass, 0 fail) ok.

Not changed, with reasons:

  • Codex MEDIUM: a drive caller can set another provider. Only callers that may already name the PC's account (its own window or a drive member of that account) can set it, and the worst result is a wrong hint about which sign-in button to press; nothing is granted. Checking it against the account service would need an account-service change, out of scope here.
  • Codex MEDIUM: a sign-in method removed from the account stays named. The PC cannot see the account's linked methods without the account service; not reproduced, and the hint stays the best word the PC has. Left as is.
  • Codex LOW items (provider visible to relay drive members, addByList naming without provider, ovis join rollback dropping the provider): low impact on a hint line only; noted, no change.

@devswha
devswha merged commit 7707c3c into main Nov 27, 2026
21 checks passed
@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 025fcf9e4. 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.

main moved but untouched: merged without update. Its new commits up to 5d5b6be39 change no file of this pull request, none imported by one, nothing that decides which checks run, and no core path.

Reviews at this head's change: omo gate reviewer (gpt-6.2-astra) and Codex gpt-6.2-sol-fast xhigh, once each, no HIGH; their MEDIUM on the second status read and the LOW double file read fixed in 025fcf9, the rest answered in the PR comment. CodeRabbit did not review this head (limit). Maintainer approved the mockup and the additive contract field through the lead (Dori). Local bun run check fast green after the fix.

@devswha
devswha deleted the fix/other-account-hint branch November 27, 2026 09:51
devswha added a commit that referenced this pull request Nov 28, 2026
…connection in one place (#4998)

## Summary
Two cleanups of **Settings > Devices > Add a connection**, now that
#4993 is in main:

1. **One "other account" notice.** The same notice was drawn twice (same
test id). It is now one piece (`OtherAccountNotice.tsx`) with three
states:
- the PC's own account no longer exists: one "Moving this PC…" line and
no buttons; in the PC's own window with Step 2 on, the tab asks the PC
for the existing gone-account move once (`moveFromGoneAccount`) so it
can see it end; if that fails, the two buttons below come back with
"Couldn't move this PC. Try again."
- the PC belongs to another living account: [Move this PC] and [Sign in
with the PC's account], as before. Never moved without a press.
   - Step 2 off, or after choosing the PC's account: the #4882 wording.
2. **Each input in one place.** The Tailscale tab no longer repeats the
relay code/QR or the "Tailscale app must be on" warning, the address
field and "retry PC list" live in one tab, and the "scan with the phone
app" QR is not shown on a touch screen (`(pointer: coarse)`), where it
cannot be scanned. Nothing the user could do is lost: the code and the
address field each remain in one place.

No new control; the layout and icons stay.

## Before / after (light; full set of 32 pairs on the evidence branch
`qa/a2-other-account-evidence`)
| | Before | After |
|---|---|---|
| Tailscale tab (desktop) | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-addconn-tailscale-desktop.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-addconn-tailscale-desktop.png"
width="360"> |
| Tailscale tab (phone) | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-addconn-tailscale-phone.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-addconn-tailscale-phone.png"
width="360"> |
| SSH tab (desktop) | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-addconn-ssh-desktop.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-addconn-ssh-desktop.png"
width="360"> |
| Ovis relay tab (phone): no scan QR on a touch screen | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-addconn-relay-phone.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-addconn-relay-phone.png"
width="360"> |
| PC whose account no longer exists: moving line, no buttons | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-notice-a-gone-desktop.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-notice-a-gone-desktop.png"
width="360"> |
| PC of another living account: Move / Sign in with the PC's account |
<img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-notice-b-other-desktop.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-notice-b-other-desktop.png"
width="360"> |
| Step 2 off: the #4882 wording | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-notice-c-step2-off-desktop.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-notice-c-step2-off-desktop.png"
width="360"> |
| Other living account (phone) | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/before-notice-b-other-phone.png"
width="360"> | <img
src="https://raw.githubusercontent.com/devswha/ovis/ed02aec9d937d70ac20167f46dbbbc0988fb2fdb/after-notice-b-other-phone.png"
width="360"> |

## Tests
- `OtherAccountNotice` states in `RelaySignIn.test.tsx` (moving line and
no move button for a gone account, failure fallback, a living account
never moved without a press); `ConnectPhoneDialog.test.tsx`: tests of
removed UI gone, the remaining place asserted, one new touch-screen
case. `movePc.test.ts`, `account-move.contract.test.ts` unchanged.
- `bun run check fast`: exit 0 (30151 pass, 0 fail); focused +
conventions 1056 pass; `checkRelayPanel` and `checkConnectDialogScroll`
pass.

## Reviews (before opening)
- omo-native-code-reviewer at e0988e2: CLEAR (no living-account
auto-move path; the gone-account request is guarded once per mount, no
loop). Notes kept for later: one test mostly asserts removals (MEDIUM);
the moving line may not be announced by some screen readers (LOW).

Japanese and Chinese wording of the one new line is unreviewed by a
native speaker.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant