Device identity provisioning — stable per-device credentials
Status: Delivered
CAS: CAS-3676
Delivered: 2026-05-18
PRs: #996 (device identity), relay URL hotfix (d13acfa8), Build 30
What’s new
Casaconomy now assigns every installation a stable, unique identity the moment the app first launches. Before this change, the desktop app identified itself to the sync relay as "local-device" with vault "default-vault" — hardcoded placeholders that made it impossible to distinguish one user’s devices from another’s. Now each device gets a UUID-based device_id and vault_id that persist across restarts and are carried through every pairing and sync operation.
This was the foundational gap behind the CAS-3073 multi-device sync failures: pairing could “complete” without any canonical device row ever being written to the relay, so neither side could identify the other.
How to use it
This is automatic and invisible to you as a user. When you open Casaconomy on any device for the first time after this update, the app provisions its identity in the background:
- A stable
device_id(UUID) is generated and stored locally in SQLite. - A
vault_idis derived and persisted alongside it. - All subsequent pairing and sync traffic from that device carries this identity.
You do not need to do anything. The identities survive app restarts; they are only re-provisioned if the local database is wiped.
What changed under the hood
src-tauri/src/types/app_state.rs—AppStatenow bootstraps with a real UUIDdevice_id/vault_idrather than the"local-device"/"default-vault"literals that blocked CAS-179/184 since launch.src-tauri/src/repository/devices_db.rs— addedupsert_local_device, the previously missing write path that persists the provisioned identity to SQLite and registers the device’s Ed25519 public key from the OS keychain.src-tauri/src/services/invite_service.rsandcloud_sync_commands.rs— pairing and invite commands now read the provisioned identity from app state instead of the placeholder constants.- Relay URL corrected — three files defaulted to the dead host
relay.casaconomy.workers.dev; patched to the livesync.casaconomy.comin the follow-up hotfix (CAS-3684, commit d13acfa8). - Integration test gate (CAS-3682) — a real integration test now asserts pairing/changeset data lands in Cloudflare D1/R2, so this class of phantom-fixed bug cannot recur.
Why we built it
CAS-3073 (same-user multi-device sync) was marked “fixed” multiple times without ever working end-to-end, because the underlying device identity layer (originally scoped to CAS-179 and CAS-184, deferred at the time) was never built. Every fix applied to the sync layer above it failed silently, since there was no real device row to build on. This epic built that foundation from scratch: a stable identity that every future sync feature can rely on.
Known limitations / follow-on work
- The regent round-trip test (desktop shows paired phone; phone receives vault) is required to confirm the full CAS-3073 acceptance bar — that test was pending TestFlight build 30 as of delivery.
- Cross-device discovery (showing peer devices after pairing) is a separate layer — see CAS-3704/CAS-3705.