Skip to content

Node watcher is a no-op on Windows, so the app never receives live node and relationship events #3968

Closed

Description

@mstomar125

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_database and GrpcClient::echo_suppressed_client (neither gated), tokio watch/select, tonic watch_nodes, and window_routing::emit_routed (not gated).
  • GrpcClient already 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 and watch_nodes (daemon/src/services/node_service.rs:2981) is not gated.
  • No other watch_nodes subscriber 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

  1. self-assigned this
    on Nov 5, 2026
  2. mstomar125 commented on Nov 5, 2026

    @mstomar125
    ContributorAuthor

    Picking this up (sweep drain).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions