fix: ignore stale bank selection responses - #28
Merged
Conversation
chrlesur
approved these changes
Jul 8, 2026
chrlesur
left a comment
Collaborator
There was a problem hiding this comment.
Review
Verdict: APPROVE — the guard correctly kills the cross-space stale render described in #24, on every post-await render path.
Checks performed
- Diff analysis against current
main(bank.jsunchanged since the PR was opened; merge state CLEAN). - All three render paths verified behind the guard: markdown success, non-ok
else, and non-Unauthorizedcatch. TheUnauthorizedpath keeps its existing no-render behavior. - Ordering verified:
app.currentBankFile = filenameruns before the capture, so for two rapid clicks A→B only B renders (A is dropped by thecurrentBankFilecomparison). - Space-switch interaction verified:
app.jsresetscurrentBankFile = nullon space change andrenderBankTabs()re-selects the first file, so a dropped stale response is always followed by a fresh render — no orphaned "Loading…" state. tests/test_live_ui_bank_race_guard.py: 2 passed. It asserts both the presence AND the ordering of the guards (guard before eachinnerHTMLwrite), and it fails if the guard is removed — acceptable rigor given the repo has no JS harness.- Full suite on the PR branch: 415 passed + 1 xfailed (baseline 413 + the 2 new tests). Zero regression.
Residual, out of scope for #24 (optional, no change requested)
- Same-key race: two concurrent
selectBank()calls with the same space and same filename both pass the guard; the older response can land last and win. Distinct from the cross-space bug fixed here; a strict "latest request wins" would need an incremental request token. Not worth blocking this PR. - Same reasoning applies to the A→B→A round-trip during flight: the render is always the right space/right file, but last-writer ordering is not guaranteed. Same fix family as point 1 if it ever matters in practice.
Note: the uv.lock parse issue mentioned in the PR body is tracked by #27 and does not affect this change (suite runs green with the repo's standard test venv).
pull Bot
pushed a commit
to moul/live-memory
that referenced
this pull request
Jul 8, 2026
Bump VERSION, __version__ and version assert to 2.5.4; add CHANGELOG entry for the batch-failure status fix (Cloud-Temple#32/PR Cloud-Temple#33), the /live stale selectBank guard (Cloud-Temple#24/PR Cloud-Temple#28), and the LLM budget startup guard. Refresh the stale version badge (2.5.1 → 2.5.4) in both READMEs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #24.
Tests
Note: the exact
uv run pytest tests/ -qcommand currently fails before pytest becauseuv.lockis not parseable by this uv version (missing package version at line 431).