Repository navigation
Description
Severity: P1
Where
packages/desktop-app/app-lib/src/watcher.rs:79-86
#[cfg(not(unix))]
...
// No-op on Windows — watcher uses Unix Domain Socket transport.Call site, packages/desktop-app/app-lib/src/lib.rs:776 (compiled for macOS, Linux and Windows):
watcher::spawn(app_handle.clone(), grpc_client.clone(), session_token);What goes wrong
On Windows, watcher::spawn is an empty stub, and spawn, run, watch_loop and stream_once are all #[cfg(unix)]. The Windows app never opens a WatchNodes stream, so it never emits node:created/updated/deleted or relationship:* Tauri events.
Scenario: on a Windows release build (x86_64-pc-windows-msvc) the daemon is healthy and a node is written by the CLI, an agent, another client, a sync pull, or the app's own writes through the default GrpcClient::client() (collections, merges, onboarding identity, playbook installs; per grpc_client.rs:360-369 these only show up through the watcher echo). tauri-sync-listener.ts receives no event, so the change does not appear until the user reloads or restarts the app. On macOS and Linux the same actions update the UI live.
Evidence
- The stub's reason is out of date. It came from f2a9b47 (2026-06-22, "add Windows stub for watcher::spawn (Unix-only transport)"), a CI compile fix made while the watcher dialled the Unix socket itself. The watcher has since moved onto the shared
GrpcClient(see the comment at test-support/src/lib.rs:268). - Nothing in the gated bodies is Unix-specific. They use
GrpcClient::subscribe_active_databaseandGrpcClient::echo_suppressed_client(neither gated), tokio watch/select, tonicwatch_nodes, andwindow_routing::emit_routed(not gated). GrpcClientalready has a Windows Named Pipe path:connect_lazy_held->channel_lazy->pipe_channel_lazy(grpc_client.rs:697-699, 773-791). The token stream (start_token_stream_subscription, not gated) already uses this client on Windows.- The daemon side works on Windows:
#[cfg(windows)]serve paths register the node service andwatch_nodes(daemon/src/services/node_service.rs:2981) is not gated. - No other
watch_nodessubscriber exists in app-lib, and the watcher module doc calls itself the sole source of these events. - The unit tests are
#[cfg(all(test, unix))], so this path has never been tested on Windows. - Independently verified by a second trace, and a review pass found no refuting ADR, doc or comment. Not checked: runtime behaviour on a real Windows machine, and whether removing the gates compiles cleanly for the MSVC target.
Suggested fix
Delete the #[cfg(not(unix))] stub and drop the #[cfg(unix)] gates on spawn, run, watch_loop and stream_once, so Windows runs the same watcher over the Named Pipe channel. Cover it with a Windows CI compile check and a test (or the existing integration test that drives watcher::run).
Found by
Found by an automated whole-codebase review on 2026-10-26; confirmed by independent verification and a review pass.
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Nov 5, 2026
Picking this up (sweep drain).