Parent: #171 (Mobile support: iOS and Android via Tauri v2)
Summary
Replace the MAC-address-based device ID (mac_address crate) with a persisted UUID. This is a prerequisite for mobile support (iOS/Android don't expose MAC addresses) and fixes existing relay sync instability caused by MAC address drift across network interfaces.
Plan
See docs/superpowers/plans/2026-04-29-device-id-migration.md on the mobile branch.
Key Changes
- New API:
get_or_create_seed_device_id(data_dir) + resolve_device_id(conn, data_dir) in device.rs
- Priority chain:
workspace_meta → operations table → app-level seed file → generate new UUID
- Migration gate: Block new workspace creation if existing workspaces found but no seed file (forces user to open existing workspace first to extract device ID)
- Remove
mac_address dependency entirely from krillnotes-core
- Update 21 call sites in
krillnotes-desktop sync/relay commands to use workspace-held device_id instead of computing from MAC
Affects
krillnotes-core: device.rs, export.rs, workspace/mod.rs, Cargo.toml
krillnotes-desktop: lib.rs, commands (invites.rs, swarm.rs, relay_accounts.rs, sync.rs, identity.rs, receive_poll.rs)
Acceptance Criteria
Parent: #171 (Mobile support: iOS and Android via Tauri v2)
Summary
Replace the MAC-address-based device ID (
mac_addresscrate) with a persisted UUID. This is a prerequisite for mobile support (iOS/Android don't expose MAC addresses) and fixes existing relay sync instability caused by MAC address drift across network interfaces.Plan
See
docs/superpowers/plans/2026-04-29-device-id-migration.mdon themobilebranch.Key Changes
get_or_create_seed_device_id(data_dir)+resolve_device_id(conn, data_dir)indevice.rsworkspace_meta→operationstable → app-level seed file → generate new UUIDmac_addressdependency entirely fromkrillnotes-corekrillnotes-desktopsync/relay commands to use workspace-held device_id instead of computing from MACAffects
krillnotes-core:device.rs,export.rs,workspace/mod.rs,Cargo.tomlkrillnotes-desktop:lib.rs, commands (invites.rs,swarm.rs,relay_accounts.rs,sync.rs,identity.rs,receive_poll.rs)Acceptance Criteria
mac_addresscrate removed from Cargo.tomlcargo test -p krillnotes-corepasses