Skip to content

fix(remote): end the pairing on the other machine when it is removed - #4419

Merged
LHagfoss merged 1 commit into
mainfrom
fix/remote-unpair-on-remove
Nov 25, 2026
Merged

LHagfoss merged 1 commit into
mainfrom
fix/remote-unpair-on-remove

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Removing a machine used to forget it only on this computer: the other machine kept this computer's device record, usually with full ACP access. Now Remove asks the machine to end the pairing first.

  • Remote protocol: an authenticated device may send {"type":"unpair"}. The gateway revokes the record the socket signed in as (the frame names no device), closes every connection of it with revoked, and refuses its tokens and key from then on. As a first frame it is invalid_frame. Schema, golden file and README updated; additive, protocol v1 unchanged.
  • rustcode-client: Session::unpair, plus unpair_machine (bounded to 10 s overall) and removal_message in a new unpair module.
  • rc machines remove asks the machine before forgetting it; --local skips that. The message says whether the machine still lists this computer (unreachable, or an older RustCode without unpair).
  • Desktop: machines_remove does the same and returns the message, which the Remove toast shows. The confirmation text says so.

Changelog

Removing a machine now also ends this computer's access on that machine when it can be reached, and says so when it cannot.

Testing

  • Engine e2e: a_device_ends_its_own_pairing_with_unpair (revoked answer, other connections of the record closed, tokens refused). Unit test for session_control (a prompt containing "unpair" is not a control frame).
  • Client round trip: removing_a_machine_ends_this_computers_pairing_there (Ended, then needs pairing, then AlreadyEnded).
  • CLI parse test for --local; message test.
  • Locally: cargo fmt --check, check-comments.py, check-rust-size.py, bun run check. Rust tests run in CI.

Closes #4391

@github-actions github-actions Bot added the fix A bug fix label Nov 25, 2026
@LHagfoss
LHagfoss merged commit 9b1194f into main Nov 25, 2026
13 checks passed
@LHagfoss
LHagfoss deleted the fix/remote-unpair-on-remove branch November 25, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(remote): end the pairing on the other machine when it is removed

2 participants