Keep my identities in sync across devices
Once the vault is connected, identities added, renamed or removed on any device reach the others without the person doing anything.

As an identity holder, I want my identities to stay the same on all my devices by themselves, so that I never have to move a key by hand again.

Situation

My phone is connected to my remote vault. I also use Seed on a computer and in the web vault. I add, name and remove identities in any of those places and expect the others to follow.

What I do

    Use the app as usual. Sync needs nothing from me.

    Create, import, rename or remove an identity on the phone.

    Or do the same on another device, then open Seed on the phone.

    To check, open Me, then "Vault", and read the "Storage" section.

    To hurry it, tap "Sync now".

What I should see

    Vault shows "Remote", my vault's address, a line such as "Local 4 · Remote 4 · Synced 4", and "Last sync: " with a date and time in UTC, or "Never".

    The app syncs every 30 seconds while it is open and in front, once each time I come back to it, and right after I change an identity on the phone.

    "Sync now" reads "Syncing…" while it runs.

    An identity I add on another device appears in the Vault list and on Me after the next sync, ready to use.

    An identity I create or import on the phone appears on my other devices.

    An identity I remove on any device disappears from all of them.

    A key name I set on the phone reaches devices that have no name for that key. A device that already has its own name keeps it.

    If two devices change the vault at the same moment, both changes are kept. I see nothing of it.

When something goes wrong

    If a sync fails, the reason appears in red under the counters and "Last sync" shows when it was tried. My identities stay as they are on the phone. I tap "Sync now", or wait for the next automatic try.

Not included

    No sync while the app is closed or in the background, and no notification when identities change.

    Removing an identity on the phone removes it everywhere, although the removal alert only mentions this device. See Remove an identity from this device.

    The counters are plain numbers for diagnosis. There is no simple "up to date" sign, as the Vault status panel page explains.

    Sync on the screen is exercised by a scripted drive and unit tests, not by the automated interface tests. See Mock vault.

Trace

Story US-VAULT-02, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.

Design

Page

Part it plays

Vault

The Storage section in remote mode and the identities list

Me

Where synced identities appear and disappear

Identity detail

Rename and remove, the edits that travel

Vault status panel

Mode, address, the three counters, last sync, sync error, Sync now

Identity rows

Vault and Me identity rows that follow the sync

button

Sync now and its Syncing… state

Badges, countdowns and connection status

Counters and last sync time as status text

Refresh, haptics and progress

Progress wording on the button while syncing

Loading, failure and empty states

A failure that leaves content in place and offers a retry

States for every screen

The connected state of Vault

Cards and panels

The status panel treatment

Honest state: loading, failure and empty

Sync shown as plain facts

Names, not identifiers

The same names in Vault as in Me

Platform colour roles in use

System red for the sync error

Implementation

Page

Part it plays

Vault: remote vault device role

Orientation: vault state as the source of truth, the Keychain map as a copy

Vault: API and sync

One sync pass: fetch, merge, upload decision, conflict retry

Vault: merge and tombstones

The merge rules: deletions, re-creation, per-device key names, unknown fields

Vault: the store and on-device format

reconcile, rebaseKeys and publishKeys between vault and Keychain

Vault: screens and tasks

vaultSyncTimer, vaultForeground, vaultTrackMe and vaultRestoreIdentities

Identity: key storage

The Keychain map the vault publishes into, and the removal marker

Me: sources and import logic

The create, import, rename and remove edits that the vault picks up

Crypto: vault envelope and state codec

State encoding that keeps fields from newer clients

Vault server

Versions, conflicts (409) and the unchanged answer

Root declarations: Me, Profile, Crypto and Vault

The sync tasks and the queued vaultEdited mutation

State, refresh and stale-reply patterns

vaultChanged refreshes vaultStatus and meIds

Where the app yields for the turn budget

Yields in every sync phase and per account

The data module runtime (Hermes)

Why error classes are built the way they are on device

Mock vault

The fixture server, conflict injection and the scripted sync drive

Real vault compatibility suite

Two-way sync and a real conflict against the real server

Bun unit tests

The vault unit tests

Code

File

What

vault.contract L63-94

VaultScreen Storage section: mode, counters, last sync, sync error, Sync now

vault.contract L96-119

VaultScreen identities section

app.contract L254-270

vaultStatus, vaultChanged, vaultEdited, vaultTrackMe, vaultSyncTimer, vaultForeground, vaultRestoreIdentities

app.contract L709-727

vaultCommand, vaultSyncTick, vaultMeChanged, vaultAfterChange, vaultRefreshIdentities

src/vault/store.ts L382-426

VaultStore.sync

src/vault/store.ts L154-258

publishKeys, reconcile, rebaseKeys

src/vault/store.ts L270-279

VaultStore.read: reconcile, then sync at once when something changed

src/vault/sync.ts L58-147

runRemoteSync

src/vault/merge.ts L171-300

mergeStates and mergeNormalizedStates

src/vault/merge.ts L116-164

statesEqual, alignDifferingLabels, labelFreeFor

src/vault/api.ts L110-166

getVault and saveVault

Tests

File

What it checks

src/vault/__tests__/vault.test.ts

sync downloads remote changes, uploads Me edits, retries 409 and persists counters

src/vault/__tests__/vault.test.ts

three conflicts stop with an error; retry recovers without losing local keys

src/vault/__tests__/vault.test.ts

rename and deletion in Me synchronize with a tombstone

src/vault/__tests__/vault.test.ts

Me edits made during remote fetch survive publication of the remote snapshot

src/vault/__tests__/vault.test.ts

merge preserves unknown CBOR fields, notifications and deletion/resurrection ordering

src/vault/__tests__/vault.test.ts

a key name is a per-device label: two labels never rewrite the vault, a label fills in where there is none; a label taken from the remote never duplicates a name another local key holds

.tests/real-vault/real-vault.test.ts

phone add, rename and remove reach the server and the web vault; web vault additions and deletions sync to the phone; a real 409 when the web vault writes mid-sync keeps both edits; an idle sync asks with knownVersion, gets "unchanged" and uploads nothing

tools/mock-vault/drive.mjs

scripted drive of the built app: Sync now, a sync error shown and cleared (run by hand)

Delivery

Delivered by #1470.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Attributes
Epic
Vault
name
Keep my identities in sync across devices
Story
US-VAULT-02
Status
Shipped
summary
Once the vault is connected, identities added, renamed or removed on any device reach the others without the person doing anything.