Sync: no 'vault leave' hint for your own vault, hidden or on a fresh device (#998) #26
Loading…
Reference in a new issue
No description provided.
Delete branch "board/998-ec2a75"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #998 (agentboard). Stacked on PR #18 (#979): the base is
board/979-ebe940; merge #18 first (Forgejo retargets this PR tomainwhen #18's branch is deleted), or catch this branch up with main after #18 is squash-merged.When a vault that counts against you fails to sync or isn't listed, sync suggests
plaintext vault leave <id>. If you're the only one left in the vault, following that deletes it. A lying server could still get that hint shown for your own vault in two ways: by hiding it (dropping it fromvaultswhile keeping it inpaid), or on a fresh device, where a replayed old copy is caught by the keyring's roster checkpoint but no copy is cached locally.Change
Session::is_own(client/src/lib.rs) decides whether a vault is yours. If the device has a verified roster for it, the vault is yours when you created it (roster v0's signer) and that roster lists you as an active owner. If it has no verified roster, the vault is yours only when it'skeyring.default_vault, the vault made at signup.paidthat isn't listed. An own vault that's hidden is still named, as "vault X counts against your storage, but the server isn't listing it for you (it's yours: don't leave it for that, a server can hide it on purpose)". The earlier text, "only an agent of yours is in it, or your access expired", would be wrong for it.plaintext vault leavewarns before you leave your signup vault.Tests (client/src/tests.rs)
lying_server_and_hostile_userssection 3:nobody_is_stuck_paying_for_a_vault, carol/Old: the setup changed. Before, her expiry was set only in the server's database, which looks the same to her device as a server hiding her vault. Now bob demotes her to writer with a signed expiry, carol syncs, and then the expiry passes. She still gets the hint.Accepted costs
cargo clippy --locked --all-targets -D warningsandcargo test --lockedpass locally.🤖 Generated with Claude Code