Repository navigation
fix: notice conversation-list writes made by other processes - #1638
Merged
Merged
Conversation
The sidebar, recent list and archived shelf are drawn from `app.db`, which any process sharing this home can write — `future session archive` in a terminal, a monitor script, another client. Every event the host publishes comes from its own code paths, so an open window kept drawing the list it read at startup: conversations archived from the CLI days earlier were still on screen with no refresh in sight. The window entry now polls a fingerprint of the list-drawing part of the catalogue every ten seconds and publishes `threads-updated` plus `archive-changed` when it moves — the two streams the desktop re-reads on receipt, since a live-conversation re-list does not cover the shelf's `archived` / `workspace-archived:<id>` pages. The fingerprint counts conversations per lifecycle state, pinned rows and workspaces — not `PRAGMA data_version`, which moves on every commit including a running reply's once-a-second activity stamp, and would re-list every conversation continuously. A rename that changes nothing else, and a conversation moved between workspaces, deliberately do not re-list on their own; another writer's such change arrives with a lifecycle change anyway. `store::poll_catalogue_change` takes the previous reading from its caller, so the six new tests drive it with their own baseline: archive, restore, pin, delete, workspace archive and a quiet store, plus the activity-stamp case that pins why counts are used instead of `data_version`.
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.
An open desktop window kept drawing the conversation list it read at startup. Any process sharing this home (
future session archivein a terminal, a monitor script, another client) writesapp.dbwithout publishing an event this host can see, so conversations archived elsewhere days earlier stayed on screen with no refresh in sight. The window entry now polls a fingerprint of the list-drawing part of the catalogue every ten seconds and asks the window to re-read both the live conversations and the archived shelf when it moves.Commits
fix: notice conversation-list writes made by other processes— newhost/src/store/watch.rscounts conversations per lifecycle state, pinned rows and workspaces as one comparableCatalogueFingerprintand exposespoll_catalogue_change;host/src/scheduler.rsruns the pass every ten seconds from the window entry and publishesthreads-updatedplusarchive-changedonly when the fingerprint moves (six new tests: archive, restore, pin, delete, workspace archive, quiet store, plus the activity-stamp case);desktop/src-tauri/src/scheduler/mod.rsstarts the job.Verification
cargo fmt --all -- --check— cleancargo check -p future-host --all-targets— cleancargo clippy -p future-host --all-targets -- -D warnings— cleancargo check -p futureos --all-targets— cleancargo clippy -p futureos --all-targets -- -D warnings— cleancargo test -p future-host --lib— 2287 passed / 0 failed / 15 ignored (461s)Notes
The poll runs in the window entry only: a headless host has no presentation to refresh, so
start_store_watchis called fromdesktop/src-tauriand not from the headless entry. The fingerprint deliberately does not usePRAGMA data_version, which moves on every commit including a running reply's once-a-second activity stamp, and would re-list every conversation continuously. A rename that changes nothing else, and a conversation moved between workspaces, do not re-list on their own.User-visible changes
app.dbevery ten seconds while a window is open. Revert1d6008471.