Files
buzz/desktop/src-tauri
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger b9f0dd2319 fix(desktop): handle invalid retention rows and remove sentinel file
The migration wrote synthetic events with zero pubkey/sig when signing
keys were unavailable at startup. These rows break load_from_retention
because nostr::Event deserialization rejects the placeholder values.
Additionally, the sentinel file (migration_state.json) caused a
filesystem write on every launch regardless of whether migration ran.

Fix both criticals:

1. Migration now resolves keys from the identity.key file (which exists
   from prior launches), making the no-keys path unreachable in practice.
   When it is reached, stores content-only rows (empty raw_event,
   "unkeyed" placeholder pubkey) instead of invalid synthetic events.

2. load_from_retention branches on raw_event validity: tries nostr::Event
   parse first, falls back to parsing the content column directly as
   PersonaEventContent. Also queries for unkeyed migration rows.

3. Replaces the sentinel file with a DB-row-exists idempotency check,
   eliminating write amplification on every launch.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-10 10:42:01 -04:00
..