Skip to content

fix(shared): a device that handed its place to another key of its own is still in - #4605

Merged
devswha merged 1 commit into
mainfrom
fix/account-list-follower-handover
Nov 24, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/account-list-follower-handover

Conversation

@devswha

@devswha devswha commented Nov 24, 2026

Copy link
Copy Markdown
Owner

What

A device that handed its place to another key of its own is still in, by the follower's reading (standing in shared/account-list-follower.ts).

In a list that carries an account in, a device comes in by its sign-in key (entry 0's signer, or a key that was carried in) and then hands its place to its account key with one device entry that adds that key and ends its own signer. The follower keeps the key a member came in by (me.key) and read a device's standing at that key, so the device read as out from its own hand-over on, showed no PC and read no more.

  • standing reads whether a device is in at the key that stands in its place now (standsFor in shared/account-list-migrate.ts, on main since feat(shared): moving an account that was in use onto its signed list, the pure part #4596): the key itself, or the last key it handed its place on to. A device removed after its hand-over is out, whichever key the removal named, and a key that was only removed handed its place to nobody.
  • What a pin asks for (genesis: entry 0 is signed by its key; carried: its key was carried in) is still read at the key the member came in by, which the save keeps. Nothing in the save changes.
  • A PC's own standing and admitsSession are untouched: a PC admits whatever key the list holds as a device, so it already lets the new key in and refuses the old one.
  • The words on the migrated pin follow how a PC comes to it now: its admitted keys are entry 0's signer and every key the list carries in, checked for it before the pin.

Why

The case is the migration's (P14): every device of an account that was in use before it had a list goes through this hand-over. The test is the one the migration lane wrote for it, taken into the follower's suite.

Validation

  • bun run check fast: green (unit 26431 pass / 0 fail, typecheck, build).
  • bun test shared/account-list-follower.test.ts: 96 tests; the new one failed before the change (both devices read out).
  • The test files that reach the follower through a caller, and the migration's own: 417 tests pass.
  • Skipped locally: integration and browser suites (CI runs them).

Known limits

  • The follower follows a hand-over only for a device. A PC's key does not move this way.

🤖 Generated with Claude Code

… is still in

In a list that carries an account in, a device comes in by its sign-in
key and then hands its place to its account key with one entry that
adds that key and ends its own signer. The follower read a device's
standing at the key it came in by, so the device read as out from its
own hand-over on. It is read now at the key that stands in its place
(standsFor): itself, or the last key it handed its place on to. What a
pin asks for is still read at the key the member came in by, which the
save keeps.

The words on the migrated pin follow how a PC comes to it now: its
admitted keys are entry 0's signer and every key the list carries in,
checked for it before the pin.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Device access now remains active when a device’s key is handed over to a successor key. The previous key is no longer treated as active, and removing the active key removes the device from the list.
    • Migrated account lists are refused if the first signer or any carried-in device key has not been admitted.
  • Documentation
    • Clarified the admission checks that apply to migrated account lists.

The documentation updates migrated-PC admission rules. The account-list follower now checks device standing through the key that stands in for the device. Tests cover device handovers, removals, sessions, and saved state.

Changes: Account-list migration and device standing

Layer / File(s) Summary
Migrated-pin admission rules
docs/account-list.md, shared/account-list-follower.ts
The documentation says a migrated pin must admit the entry-0 signer and every carried-in device key.
Standing across device handovers
shared/account-list-follower.ts, shared/account-list-follower.test.ts
The follower uses standsFor to determine whether a device is in. Tests cover handovers, removals, sessions, and saved state.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • devswha/ovis#4596: Both PRs cover migrated-list handovers and carried-key admission rules.
  • devswha/ovis#4583: This PR modifies the follower and migrated-PC rules introduced by that PR.
Merge Risk: Minimal · up to 423f5

The change makes a device that handed its place to a replacement key read as "in" while the replacement is active, and "out" once the device is removed. No concrete defect was found, and the new tests cover handovers, removals, sessions and saved state. It looks ready to merge once CI passes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix: a device that handed its place to another key of its own is still in. The PR changes the follower's standing check to read at the key that now stands in for the device (stands…
Description check Passed The description covers the problem (device hand-over reads as out), the resulting behavior, the migration case (P14) it comes from, and validation results with commands and test counts. It skips the C…
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 fix: a device that handed its place to another key of its own is still in. The PR changes the follower's standing check to read at the key that now stands in for the device (standsFor), which matches the title. The title is 81 characters, slightly long, but it is specific and not vague.

Full details: Description check

Explanation

The description covers the problem (device hand-over reads as out), the resulting behavior, the migration case (P14) it comes from, and validation results with commands and test counts. It skips the CONTRIBUTING.md and changelog.d pointer from the template and does not state whether a changelog entry was added. Those gaps are minor, so the check passes.

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 155cedf and 423f59d.

Files selected for processing: 3

  • docs/account-list.md
  • shared/account-list-follower.test.ts
  • shared/account-list-follower.ts

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

@devswha
devswha merged commit a21cbbd into main Nov 24, 2026
21 checks passed
@devswha
devswha deleted the fix/account-list-follower-handover branch November 24, 2026 11:04
@devswha

devswha commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 423f59d31. 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 reviewed this head.

One line in the follower: a device's standing is read at the key that stands in its place now (after a hand-over to its account key), not at the key it came in by; the pin's own condition and the save keep the key it came in by. It only matters for a list born by migration, which no account has (a service switch, empty). The failing test came from the migration design's own review and is now in the follower's suite; a PC's standing and admitsSession are untouched. No separate adversarial review: the case and its expected answers were fixed by the two reviews of the migration design.

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