Skip to content

feat(host-cli): notify removed devices - #584

Open
pgherveou wants to merge 6 commits into
mainfrom
fix/notify-removed-paired-device
Open

feat(host-cli): notify removed devices#584
pgherveou wants to merge 6 commits into
mainfrom
fix/notify-removed-paired-device

Conversation

@pgherveou

@pgherveou pgherveou commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • send one SSO Disconnected message to the selected pairing host before deleting its local pairing
  • keep peer-initiated disconnect cleanup local so it never echoes another disconnect
  • preserve the saved pairing, responder, and renewal target when notification submission fails
  • add focused runtime and CLI regression coverage plus a reusable two-host CLI harness

This matches the removal order on polkadot-ios-community/develop: RemoveDeviceInteractor awaits disconnectHost, and SSOTruAPICoordinator sends its disconnect request before removing the host. The iOS contact-device broadcast has no CLI equivalent and is not included here.

Verification

  • cargo +nightly fmt --check
  • RUSTFLAGS='-D warnings' cargo build --workspace --all-targets --all-features
  • RUSTFLAGS='-D warnings' cargo check --target wasm32-unknown-unknown -p truapi-server
  • both CI truapi-provider clippy configurations with warnings denied
  • workspace clippy for all features and targets with warnings denied
  • RUSTFLAGS='-D warnings' cargo test --workspace --all-features --all-targets
  • RUSTFLAGS='-D warnings' cargo test -p truapi-server disconnect_paired_host --all-features
  • bash -n rust/crates/truapi-host-cli/e2e/device-removal-disconnect.sh
  • shellcheck rust/crates/truapi-host-cli/e2e/device-removal-disconnect.sh
  • Prettier check and Bun compilation for device-removal-disconnect.ts
  • generated Rust diff and generated TypeScript wire-table parity checks
  • git diff --check

All checks passed. The workspace test run included 814 server tests, 219 passing CLI unit tests with one declared network test ignored, and all 14 CLI process tests. Existing network-dependent tests remained ignored by their declarations.

Live two-host verification

Merged current main, including #587's deployed People proof contexts, fixes the earlier allowance Invalid Transaction (1010) prerequisite failure.

The harness passed with separate pairing-host and interactive signing-host CLI processes on both paseo-next-v2 and previewnet. Each run proved:

  • the pairing host observed the exact Connected, Disconnected sequence
  • both remote disconnect markers occurred only after removal was confirmed
  • persisted pairing-host AuthSession key 00 was cleared
  • the signing host reported an empty device list after removal
  • the success path removed its isolated signer, pairing, and log directories

@pgherveou
pgherveou marked this pull request as ready for review September 4, 2026 13:01
@pgherveou
pgherveou requested a review from a team September 4, 2026 13:01
Comment thread rust/crates/truapi-host-cli/src/main.rs
Comment thread rust/crates/truapi-host-cli/tests/signing_host_cli.rs Outdated
Comment thread rust/crates/truapi-host-cli/tests/signing_host_cli.rs
Comment thread rust/crates/truapi-host-cli/src/main.rs Outdated
TarikGul and others added 2 commits September 4, 2026 13:19
…ordering asymmetry

The preservation test drives the no-local-session failure rather than a
notification rejection, so it is named for that and points at the two
places the other failures are covered.

The notify-then-remove order fails asymmetrically: a failed notification
keeps everything, while a failed local removal after a successful
notification leaves the peer disconnected and the device still listed.
Stating which direction is preferred keeps the order from reading as an
accident.
Keep normal removal notify-first for iOS parity, while allowing operators to drop local responder state when disconnect submission fails.
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.

2 participants