Skip to content

fix(linux): prevent tasks from appearing under the wrong list after view switch - #44

Merged
turinglambdaai merged 3 commits into
mainfrom
fix/linux-drop-stale-list-snapshots
Oct 21, 2026
Merged

turinglambdaai merged 3 commits into
mainfrom
fix/linux-drop-stale-list-snapshots

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Data-identity bug

Linux's reload_snapshot() captured the requested view/list parameters but applied every asynchronous response without checking whether the user had selected another list while the RPC ran. Switching from 工作 to 生活 could briefly render the older 工作 rows under the 生活 heading. The database-open path separately rendered the initial All snapshot after restoring last-selected-list-id, producing the same misleading UI after launch.

These display issues are independent of whether add_task writes the correct list_id; both must be guarded.

Changes

  • Capture requested view kind, concrete list ID and show-completed state with the async snapshot callback; reject obsolete replies and reload the current view after releasing the in-flight gate.
  • When open_database returns an initial All snapshot but a named list is being restored, populate list names/counts and hold task rows empty until a filtered snapshot completes.
  • Record view-scoped rendering as an explicit cross-platform product contract.

Verification before merge

  • Linux GTK native build, backend contract tests and packaged Product Acceptance green
  • Rapidly alternate 工作 ↔ 生活 while tasks are present in both; no wrong-list rows under either title
  • Close/reopen database with 生活 selected; no 工作 tasks appear during initial load; correct list tasks appear after load
  • Toggle completed while a previous query is pending; do not show old completed visibility
  • Switch smart views/search while replies are pending; current view always wins
  • Verify no infinite reload loop with slow/failed backend responses

Independent PR built from main. Integrate alongside Linux #33/#34/#38/#43 (which also touch linux/src/main.cpp) and re-run combined checks. No merge/release until verified.

@turinglambdaai
turinglambdaai merged commit fbfad75 into main Oct 21, 2026
5 of 10 checks passed
@turinglambdaai
turinglambdaai deleted the fix/linux-drop-stale-list-snapshots branch October 21, 2026 03:42
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