Repository navigation
Fix keybindings pending-save success path races - #20
Conversation
ElSargo
left a comment
There was a problem hiding this comment.
Brood QA — COMMENT (approve intent)
Note:
ghis authenticated as ElSargo (PR author), so GitHub blocks a formal APPROVE on own PRs. Treat this as an approve recommendation.
What this does
Closes audit C3 / friction “Keybinding save replies survive cancellation”:
handle_savednow requires a matchedpending_savebefore success or failure mutates UI; missing → no-op; mismatched action leaves pending intact for the real reply.- Late
picker-createdafter close/cancel (!picker_requested) sendspicker-cancelinstead of resurrecting the modal. Showalso skips opening whilepending_save/captureis set.- Friction doc marked remitted (with honest note that attempt-id correlation is still future work).
Evidence
- CI: Fail is infra — runner
No space left on devicewhile unpacking rustc (job104941764001). Not a code/test signal from this diff. - Local:
RUSTFLAGS='-C linker=cc' cargo testinplugins/keybindings→ 12 passed (includes the five new race tests). - Diff is tightly scoped (keybindings plugin + friction note). Residual same-action overlapping-save correlation is documented and acceptable for this remit.
Nits (non-blocking)
- No dedicated unit test for the new
Showpending/capture guard. - Manual desktop smoke in the PR checklist is still open; unit coverage of the cancel/stale paths is strong enough not to block.
Verdict
Approve (via comment). Optional light desktop check (capture → cancel before reply; confirm no picker reopen) can follow post-merge or before if convenient. Re-run CI when the runner has disk space if a green check is required by policy.
ElSargo
left a comment
There was a problem hiding this comment.
Brood QA review
Checked: gh pr diff / gh pr view; CI run 35139971303; audit C3 in /workspace/manifold-audit-report.md; friction entry in docs/frictions/ui-concurrency.md (updated in-PR).
Code: Matches the intended C3 fix. handle_saved now requires a matched pending_save before success or failure UI mutation; mismatched replies leave pending intact. Late picker-created after cancel (picker_requested == false) sends picker-cancel. Unit tests cover matched success, unmatched/stale success, cancelled pending, failure restore, late picker create. Show also guards overlapping capture / in-flight save.
CI: FAILURE — GitHub Actions Nix build hit ENOSPC (No space left on device) while unpacking toolchain deps. Not a signal on this diff; infra disk pressure on the runner. Author reports local plugins/keybindings tests green (12).
Race-doc: Keybinding save + keybinding late-picker hole remitted correctly; residual noted (action-name correlation, not unique save-attempt id; session-switcher discovery pickers still open).
Desktop verify: Blocked — no nix in QA box PATH; cannot nix develop build client here. DISPLAY present but no Wayland client build path.
Residual / merge: Wait for CI re-run after runner disk relief. Likely doc conflict with other ui-concurrency.md remittance PRs (21/22/29/32). Do not merge on red CI.
— Brood QA
Require a matched pending_save before handle_saved mutates UI on success or failure, reject stale picker-created after cancel, and cover save/cancel overlap with unit tests.
cc648ba to
0a128ba
Compare
Summary
handle_savedsuccess path no longer closes the editor / clears status / reopens the action picker whenpending_saveis missing or action-mismatched. Both success and failure require a matched pending action; mismatched replies leavepending_saveintact for the real reply.picker-createdafter close/cancel (picker_requested == false) by sendingpicker-cancelinstead of resurrecting the modal.Showagainst overlapping capture / in-flight save.docs/frictions/ui-concurrency.mdto mark the remitted keybinding races.Test plan
cd plugins/keybindings && RUSTFLAGS='-C linker=cc' cargo test— 12 passed (mold unavailable on the test host; linker overridden via env only, config unchanged)keybinding-saved→ editor stays in saving state until matching reply