fix(R1): persist undo history across restarts #20

Merged
guettlibot merged 1 commits from task/r1-undo-history-persistence into main 2026-05-13 20:35:09 +00:00
guettlibot commented 2026-05-13 20:31:24 +00:00 (Migrated from codeberg.org)

Fixes the race condition where pushAction/clear/undo could run before init() loaded DB history, causing persisted state to be overwritten.

Changes:

  • UndoService: store a _ready future set by init(); all mutating methods await _ready before operating
  • All UI call-sites wrapped with unawaited() (pushAction is now Future<void>)
  • 3 new unit tests: restart persistence, append-after-restart, and concurrent init+push race

Closes part of #19

Fixes the race condition where `pushAction`/`clear`/`undo` could run before `init()` loaded DB history, causing persisted state to be overwritten. **Changes:** - `UndoService`: store a `_ready` future set by `init()`; all mutating methods `await _ready` before operating - All UI call-sites wrapped with `unawaited()` (pushAction is now `Future<void>`) - 3 new unit tests: restart persistence, append-after-restart, and concurrent init+push race Closes part of #19
Sign in to join this conversation.