Skip to content

Keep session commands responsive during disk I/O - #404

Merged
devmobasa merged 6 commits into
mainfrom
fix/nonblocking-session-commands
Oct 3, 2026
Merged

devmobasa merged 6 commits into
mainfrom
fix/nonblocking-session-commands

Conversation

@devmobasa

Copy link
Copy Markdown
Owner

Summary

Run Open, Save As, and Clear as asynchronous session commands so disk work
does not block input handling or overlay updates.

Build on the shared session transaction owner and persistence worker introduced
in the previous PR.

Changes

Nonblocking session commands

  • Advance commands through explicit phases as worker results arrive.
  • Keep one session command active at a time and wait for outstanding autosaves
    before starting its disk work.
  • Preserve save-before-open ordering, target validation, and overwrite prompts.
  • Keep the event loop processing input and UI updates while disk operations run.

Preserve live edits

  • Reject stale command completions when the canvas or interaction state changes.
  • Include properties-slider previews in active-interaction tracking.
  • Preserve live drawings, slider edits, and undo history when pending destructive
    commands are rejected.
  • Schedule recovery persistence when a rejected Clear or tool-state reset has
    already changed disk but retained live state was previously clean.

Completion and shutdown

  • Refresh session-dependent UI state when target changes commit and commands finish.
  • Keep a successfully opened canvas active if recent-session catalog bookkeeping
    fails, and report that failure through an overlay toast.
  • Preserve typed persistence and catalog errors.
  • Drain pending session work before final shutdown persistence.

Regression coverage

  • Exercise admission, worker submission, completion, and shutdown through the
    production session driver.
  • Cover edits and unfinished gestures during pending commands, including
    properties-slider previews.
  • Verify rejected board clears and tool-state resets restore retained state
    through a recovery save.
  • Cover stale receipts, worker failures, catalog errors, UI-state refreshes,
    and final persistence.

@devmobasa
devmobasa merged commit 463484d into main Oct 3, 2026
3 checks passed
@devmobasa
devmobasa deleted the fix/nonblocking-session-commands branch October 5, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant