Repository navigation
fix: wake the UI when a store write ends, close on SIGHUP, deterministic test pump - #145
Conversation
…epaint requests The frame that reports a finished store write asked for no frame after it. The write's store could hold a newer write already due, which the timed repaint had left out while the store was writing, and a backup's drain had already run earlier in that frame: both waited for an unrelated deadline or the next input. pump_saves now asks for one more frame when a write ends. The backup and native tests bounded their waits by wall clock with the frames counted in, so one slow debug frame on a loaded runner failed a wait that was only slow, and a frame drawn every millisecond hid lost wakeups. The new pump draws a frame only when the app asks for one, through the context's repaint observer, and bounds only the idle time between frames.
SIGHUP kept its default action, which ends the process before the pending store writes are flushed (a closed terminal, a session that hangs up). It now wakes the loop like SIGTERM and SIGINT. A signal the parent left ignored (nohup) stays ignored. Tests drive the installed handler end to end: the signal wakes the loop, the close runs and the pending write is on disk.
The owed SavedAccountNames list has lived in the local config since #135. Cover the file a user updating from 2.0.0 or 2.0.1 holds: it has other local fields and no owed list, loads as an empty list, and keeps its fields once the first list is written.
…se holds on unwind The slow-frame regression asks for its next frame itself, so a late job never counts as idle. The two wake regressions answer the note write in place of the mock before the frame, instead of sleeping for the worker. Their holds go through HeldCommands, now shared, so a failed assertion releases them instead of hanging Jobs::drop.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
A note typed while its store is busy now reaches disk on the next frame instead of waiting for another input, and closing a Unix terminal now runs the normal close sequence instead of ending with writes pending. The test loop now draws only when the app asks for a frame, so a slow frame no longer looks like a hang. No comments posted: the reviewers raised no finding. Review details
Commands run (11)Runtime testing was blocked by missing toolchain: sandbox had no cargo/rustc or cc/gcc, apt has no sources/lock (non-root), and zig download URL returned 404, so passed · exit 0 · 0 s ls -R /work | head -n 200; echo ---; cat /work/README.md 2>/dev/null | head -n 200; echo ---; cat /work/package.json 2>/dev/null | head -n 100; echo ---; cat /work/Cargo.toml 2>/dev/null | head -n 100passed · exit 0 · 0 s git diff --stat HEAD~1 2>/dev/null || git diff --stat HEAD 2>/dev/null; echo ===; git log --oneline -5; echo ===; ls crates/accshift-egui/src/app/tests/; echo ===; cat crates/accshift-egui/Cargo.toml | head -n 80passed · exit 0 · 0 s git diff --stat 2100389452d4f2ef321a13936268059e8d91df4d..HEAD; echo ===; git log --oneline 2100389452d4f2ef321a13936268059e8d91df4d..HEADfailed · exit 127 · 0 s cargo test -p accshift-core --lib platforms::battle_net::tests -- --nocapture 2>&1 | tail -n 80failed · exit 1 · 0 s which rustc; ls /root/.cargo/bin/ 2>&1 | head; ls /usr/local/cargo/bin/ 2>&1 | head; ls ~/.rustup/toolchains/ 2>&1 | head; echo PATH=$PATH; find / -maxdepth 4 -name cargo -type f 2>/dev/null | headpassed · exit 0 · 0 s ls / /opt /usr/local/bin 2>&1 | head -n 100; echo ===; ls /work; echo ===; env | head -n 30; echo ===; ls /github 2>&1 | head; node --version 2>&1 | head; python3 --version 2>&1 | headpassed · exit 0 · 9 s curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup.sh && sh /tmp/rustup.sh -y --profile minimal --default-toolchain stable 2>&1 | tail -n 20; echo EXIT=$?; ls ~/.cargo/bin/ 2>&1 | head; ~/.cargo/bin/cargo --version 2>&1 | headfailed · exit 127 · 0 s export PATH="$HOME/.cargo/bin:$PATH"; ls /usr/bin/*cc* /usr/bin/*gcc* 2>&1 | head; apt-get update 2>&1 | tail -n 5; apt-get install -y gcc pkg-config libssl-dev 2>&1 | tail -n 20; gcc --version 2>&1 | head; cc --version 2>&1 | headpassed · exit 0 · 0 s id 2>&1; uname -m 2>&1; cat /etc/os-release 2>&1 | head -n 20; ls -la / 2>&1 | head -n 30; find / -maxdepth 5 -name "*clang*" -o -name "*zig*" 2>/dev/null | head; echo ===; ls /usr/local/lib/ 2>&1 | head -n 30passed · exit 0 · 0 s export PATH="$HOME/.cargo/bin:$PATH"; ls /usr/bin/ | head -n 100; echo ===; ls ~/.rustup/toolchains/*/lib/rustlib/x86_64-unknown-linux-gnu/bin/ 2>&1 | head -n 30; rustc --print target-list 2>&1 | head; echo ===; cat /work/crates/accshift-core/Cargo.toml | head -n 80passed · exit 0 · 0 s export PATH="$HOME/.cargo/bin:$PATH"; cat /work/Cargo.toml | head -n 120; echo ===; grep -r "rusqlite\|ring\|openssl\|bundled" /work/Cargo.toml /work/Cargo.lock 2>/dev/null | head -n 20; echo ===; curl -sI https://ziglang.org/download/0.14.1/zig-linux-x86_64-0.14.1.tar.xz | head -n 10 |
Note
Clanker Claude Opus 5.5 is responding on behalf of meetsu
A note typed while a save is being written now reaches the disk right away instead of waiting for the next mouse move, and closing the terminal of a Linux or macOS session no longer loses pending saves.
what changed
app/saves.rs).app/tests/pump.rs).backup_restoreandnative_regressionstests use that pump; a fixed 400 ms sleep became a wait for the debounce end.nohup) stays ignored (window/signal.rs).lib.rs).battle_net/tests.rs).to question
The flaky macOS failures of
backup_restorecame from a 3 s budget that counted frame time: a single debug frame took up to 3.04 s on a loaded machine. The new pump exposed the missing wake insaves.rs, which the old 1 ms busy pump hid.verified
build-safe node scripts/gates.mjspassed all seven gates, with 2,113 Rust tests passed, 40 Worker tests passed and 21 bundle tests passed.app::suite 30 runs under a 4-core CPU load: 0 failures; 2 of 30 failed before thesaves.rsfix.a_slow_frame_is_not_a_hang,a_write_ending_under_the_boundary_wakes_the_restore,a_note_typed_while_its_store_writes_is_written_when_that_write_ends.cargo checkandcargo clippy -D warningsfor Linux and macOS targets from Windows; they run for real in CI.wait_held,shortcuts.rs,real_unreadable.rs).Summary by CodeRabbit
SIGHUPsignal when ending a session, while respecting an inherited instruction to ignore that signal.