Skip to content

fix(session): failed saves degrade to a log line - #72

Merged
thisiscsim merged 1 commit into
mainfrom
fix/session-save-resilience
Aug 5, 2026
Merged

thisiscsim merged 1 commit into
mainfrom
fix/session-save-resilience

Conversation

@thisiscsim

Copy link
Copy Markdown
Owner

Summary

Fixes the on-screen "Something failed: … No handler registered for 'session:save'" toasts from pre-alpha testing. Root cause of the visible error was a dev app whose main process predates PR5 (restart npm run dev to load the handler) — but the toast spam itself was a real robustness gap: the store fired saveSession as bare void promises, so any rejection hit the global unhandled-rejection handler.

  • All six session-save call sites now route through persistSession, which catches both rejections and { ok: false } results and logs a warn line via log:renderer instead of toasting; the in-memory session stays authoritative and runs complete normally.
  • Regression test: a rejecting session:save leaves the completed turns intact, produces zero notices, and logs the failure (146 tests total).

Renderer-only — HMR covers it (but the original symptom still needs the dev-app restart to pick up the PR5 main process).

Test plan

  • typecheck / test (146) / build / lint / format — green
  • After restarting npm run dev: submit a Create turn, confirm no toasts and session.json written

Made with Cursor

…oasts

Session persistence ran as bare fire-and-forget promises, so a rejecting
session:save invoke — e.g. a stale main process that predates the handler
after an update — became an unhandled rejection and toasted "Something
failed" at the user twice per run. All saves now route through a
persistSession helper that catches rejections and { ok: false } results
and writes a warn line to the renderer log instead; the in-memory log
stays authoritative and the run completes normally.

Co-authored-by: Cursor <cursoragent@cursor.com>
@thisiscsim
thisiscsim merged commit eb0b742 into main Aug 5, 2026
1 check passed
@thisiscsim
thisiscsim deleted the fix/session-save-resilience branch August 5, 2026 03:54
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