Large pushes in parts, quota counts rosters and manifests, members can leave a vault #18
Loading…
Reference in a new issue
No description provided.
Delete branch "board/979-ebe940"
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?
Follow-up to #12 (board #979): big pushes, quota gaps, and handing off a vault.
Large pushes and key rotations
POST /v1/vaults/{id}/stage.staged: {id, count}), and the server commits it in the same transaction, so other devices see all of it or none.countitems gets 409, and the client stages again.api::MAX_PUSH(64 MiB) of items, because every member's next pull brings them in one response.Error::held_back()(409, 413 or 507) is the one list that sync, account deletion and the CLI tolerate.plaintext import:plaintext attachcleans up its upload after a 507.Quota
Leaving a vault
POST /v1/vaults/{id}/leave, signed by the identity key (LeaveVault {vault_id, ts}, domainleave), so a stolen session token can't delete a vault. AlsoSession::leave_vault, andplaintext vault leave, which asks for the vault's name, or takes the full id of a vault the device can't open and asks for it again.gone;GET /v1/accountlistspaid: every vault that counts against you. Sync names, with thevault leavecommand and that it counts against you, each one you aren't a current member of, each one that fails to sync (except your own vault opened before, so a server replaying an old copy can't talk you into deleting it), and, on a server with a quota, each one you can open but didn't create. The 507 text mentions leaving a vault someone handed you.import(they keep nothing on the device, so a refused push would lose it).key_checkmust be 32 bytes.Compatibility: builds from main since #12 treat a 507 as fatal in sync. Nothing has been released with #12 yet.
Tests (
client/src/tests.rs)large_pushes:leaving_a_vault:key_checkrules;nobody_is_stuck_paying_for_a_vault: an owner handed a vault with a garbage key leaves it by id as its only owner, the payer moves on and the last one out deletes it; stray wrapped keys get 400; an expired creator and a person paying through their agent are named by sync and leave.storage_quota: extended for 507, edits, new vaults, staging (including its cleanup and readers), and promote/remove/add over the quota.Reviewed in five Opus rounds, then a review verdict (one blocker, two should-fix, three minor) and two more Opus rounds; every finding is fixed or documented.
Roster changes and unknown fields (latest verdict): a roster change that adds nobody is stored, and then refused with 507 only if its unknown fields (or whitespace) grew compared with the previous roster and the account paying for the vault is over the quota afterwards. That is checked after a removed creator's charge moves on and after a new key's items are re-sealed. So a padded roster can't push an account over its quota, and one that keeps the unknown fields it had always goes through.
storage_quotacovers both cases. DESIGN also lists/stageamong the 32 MiB bodies, and says who pays when an owner removes the creator: the owner of the agent, if an agent signed, and the creator keeps paying while an agent of theirs is listed.Adding someone while removing the creator (latest verdict):
roster_within_quota). An owner over the quota can no longer remove the creator and add people in the same change: the vault moves to them, so they need room for the whole vault.storage_quota(the take-over gets 507, and passes once the owner has room) and the server unit testroster_room_leaves_out_the_signers_staged_items.Merged with main's Apple app (#14) and browser extension (#20):
Session::importdoes what the CLI import did here: a size check, every item kept on the device before any push, and the attachments left out listed in anImportReport.import_itemsreturnsImportResult { items, warning }, and the app shows the warning.sync." (plaintext …"form, which the app strips.vault reset,unsendable) and #1000 (changes to an unlisted vault):unsendableentry.vault resethints in its sync, so agents get them too.create_itemis taken back out, so a retry doesn't queue it twice.🤖 Generated with Claude Code
- Server: POST /v1/vaults/{id}/stage holds the items of a push or key rotation too big for one request; the push (or roster change) names the stage and commits it atomically. One stage per member and vault, a day at most; a stage that doesn't hold the named count gets 409. - Client stages any push or rotation over 16 MiB of items. CLI import saves what it imported when sending fails. - A full account gets 507 instead of 413, so a body-size 413 is told apart (and now says which limit it is). - Usage counts rosters and each vault's latest manifest; over the quota a push may not grow the vault's items or sealed manifest, grants need room, rotations always work, new vaults need room. Audit keeps the newest 1000 rows per vault. - POST /v1/vaults/{id}/leave (CLI vault leave): a member and their agents leave, with account deletion's per-vault rules (shared code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>- A refused stage part drops the member's whole stage; the over-quota owner allowance counts only the caller's stage; every push and roster change clears stages that can't be committed any more; a stage expires a day after its last part and can't be committed after that. - One push may write at most 80 MiB of items (413), since every member's next pull brings them in one response. - Leaving is signed by the identity key ({vault_id, ts}, domain leave), so a stolen session token can't delete a vault. - Over the quota, a manifest or roster may not grow by unknown fields. - A vault an agent leaves moves on when its payer has no way in any more. - share_vault goes ahead when the vault's own change is held back; the CLI warns that leaving drops unpushed changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>5b3018271f3bd97ed034