[Bug] TodoDock fires duplicate session-todos read on mount (0.15.10, main)
Problem / 问题
TodoDock triggers the session-todos read twice on mount for the same session, instead of once:
useSessionTodosRecovery(sessionId) → startSessionTodosRecovery() → initial refresh() (recovery read);
- TodoDock's own mount effect →
todosGet read (feature read).
Both hit todosGet for the identical sessionId on every dock mount/session switch. The recovery path was introduced with the checklist-recovery feature, so the duplicate is new behavior on current main.
Why it matters / 影响
- Every session switch/activation costs a duplicate IPC round-trip to the host;
- The recovery read and the feature read can race — the store revision fence protects correctness, but the duplicate still wastes host work and can produce flaky ordering in tests (a freshly-added test currently expects exactly one read on mount).
Suggested fix / 修复建议
Either:
- Let
useSessionTodosRecovery own the mount read and have TodoDock skip its own initial fetch when recovery is active; or
- Deduplicate inside the store:
applyTodosChanged/read wrapper drops the second in-flight todosGet for the same sessionId+revision window.
Reproduction / 复现
node --test apps/desktop/test/todo-recovery.test.mjs — the test TodoDock recovers a failed first read when the host returns without a session switch currently asserts reads deep-equals ["session-a"] after the first render+settle and fails with 2 !== 1 on current main (verified on a pristine checkout of e77404ea3, no local patches).
Note: this failure also means current main carries a red test in the desktop suite — flagging since the contributing CI workflow may not have run for the original PR.
[Bug] TodoDock fires duplicate session-todos read on mount (0.15.10, main)
Problem / 问题
TodoDocktriggers the session-todos read twice on mount for the same session, instead of once:useSessionTodosRecovery(sessionId)→startSessionTodosRecovery()→ initialrefresh()(recovery read);todosGetread (feature read).Both hit
todosGetfor the identicalsessionIdon every dock mount/session switch. The recovery path was introduced with the checklist-recovery feature, so the duplicate is new behavior on current main.Why it matters / 影响
Suggested fix / 修复建议
Either:
useSessionTodosRecoveryown the mount read and have TodoDock skip its own initial fetch when recovery is active; orapplyTodosChanged/read wrapper drops the second in-flighttodosGetfor the same sessionId+revision window.Reproduction / 复现
node --test apps/desktop/test/todo-recovery.test.mjs— the testTodoDock recovers a failed first read when the host returns without a session switchcurrently assertsreadsdeep-equals["session-a"]after the first render+settle and fails with2 !== 1on currentmain(verified on a pristine checkout ofe77404ea3, no local patches).Note: this failure also means current
maincarries a red test in the desktop suite — flagging since the contributing CI workflow may not have run for the original PR.