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): say why the relay tab shows sign-in again for another account - #4882
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
After (PC knows the way)
After (PC does not know)
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.
…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.
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
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
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.
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.
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.
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.
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.
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
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:
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-accounttakes an optionalprovider(github|google|apple). The PC keeps it inrelay/account.jsonbeside 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/statusaddsaccount_providerwhile 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.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-hintstyle, the smallest change that says why. The provider buttons stay as they are (no highlight).Screenshots (light, Korean UI)
Rendered from a fixture of
RelayTabagainst 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." foraccount_provider: "github"and the generic line for an unknown value; the PC's own account shows no line.account.contract.test.ts:relay-accountwith a provider shows in status; a naming without one, or with an unknown value, keeps it; another provider replaces it.bun run check fast.