fix(engine): bounded blocking sync push on exit #138

Merged
funman300 merged 1 commits from fix/exit-push-bounded into master 2026-07-07 03:05:17 +00:00
Owner

Review finding M3: the exit push was a detached task that process teardown almost always killed — the final session's sync silently never happened. push_on_exit now blocks the app's final frame for at most 2s (tokio::time::timeout); timeout/errors are logged and skipped, local persistence stays the durable source of truth.

Gates: workspace clippy --all-targets -D warnings clean, full test suite green (10 sync tests unchanged).

🤖 Generated with Claude Code

Review finding M3: the exit push was a detached task that process teardown almost always killed — the final session's sync silently never happened. `push_on_exit` now blocks the app's final frame for at most **2s** (`tokio::time::timeout`); timeout/errors are logged and skipped, local persistence stays the durable source of truth. Gates: workspace clippy `--all-targets -D warnings` clean, full test suite green (10 sync tests unchanged). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 1 commit 2026-07-07 03:03:44 +00:00
fix(engine): bounded blocking sync push on exit
Test / test (pull_request) Successful in 24m6s
d1264a7797
The exit push spawned a detached task on AppExit, which process
teardown almost always killed before the network round-trip completed —
the final session's sync silently never happened (2026-07-06 review,
finding M3). Local persistence meant no data loss, but stats stayed
unsynced until the next launch.

push_on_exit now blocks the closing app's final frame for at most
EXIT_PUSH_TIMEOUT (2s) via tokio::time::timeout: long enough for one
healthy round-trip, short enough that quitting never feels hung when
the server is unreachable. Timeout and errors are logged and skipped —
the next launch's pull/push converges as before.

Closes review finding M3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
funman300 merged commit 55fa7df2bf into master 2026-07-07 03:05:17 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#138