Skip to content

fix: notice conversation-list writes made by other processes - #1638

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 17, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

An open desktop window kept drawing the conversation list it read at startup. Any process sharing this home (future session archive in a terminal, a monitor script, another client) writes app.db without 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 — new host/src/store/watch.rs counts conversations per lifecycle state, pinned rows and workspaces as one comparable CatalogueFingerprint and exposes poll_catalogue_change; host/src/scheduler.rs runs the pass every ten seconds from the window entry and publishes threads-updated plus archive-changed only 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.rs starts the job.

Verification

  • cargo fmt --all -- --check — clean
  • cargo check -p future-host --all-targets — clean
  • cargo clippy -p future-host --all-targets -- -D warnings — clean
  • cargo check -p futureos --all-targets — clean
  • cargo clippy -p futureos --all-targets -- -D warnings — clean
  • cargo 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_watch is called from desktop/src-tauri and not from the headless entry. The fingerprint deliberately does not use 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, do not re-list on their own.

User-visible changes

  • An open desktop window now notices conversation-list writes made by another process: archiving, restoring, pinning or deleting a conversation, or shelving a workspace, from a terminal or another client shows up within ten seconds. Before, the list kept what it read at startup until some unrelated action refreshed it. This adds two counting scans of app.db every ten seconds while a window is open. Revert 1d6008471.

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`.
@huichen
huichen enabled auto-merge (squash) November 17, 2026 10:27
@huichen
huichen merged commit 28618ac into main Nov 17, 2026
21 checks passed
@huichen
huichen deleted the pr/huichen branch November 17, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant