Skip to content

Plan 1a: Replace MAC-based device ID with persisted UUID #172

@careck

Description

@careck

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_metaoperations 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

  • mac_address crate removed from Cargo.toml
  • Device ID persists across app restarts (read from file/DB, not computed)
  • Existing workspaces preserve their device_id on first open after migration
  • New workspaces inherit device_id from seed file
  • Migration gate prevents accidental UUID generation when existing workspaces exist
  • cargo test -p krillnotes-core passes
  • Desktop app runs with no regressions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions