Skip to content

fix(app): run the node watcher on Windows over the shared gRPC client - #4250

Merged
mstomar125 merged 1 commit into
mainfrom
issue-3968-watcher
Nov 5, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-3968-watcher

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Closes #3968

What changed

watcher.rs: removed the #[cfg(not(unix))] no-op spawn and the #[cfg(unix)] gates on spawn, run, watch_loop and stream_once, and #[cfg(all(test, unix))] became #[cfg(test)]. One code path on every platform: the watcher already opens WatchNodes through GrpcClient::echo_suppressed_client/subscribe_active_database, and the shared client's default transport is the Named Pipe on Windows (connect_lazy_held -> channel_lazy -> pipe_channel_lazy). The Windows app now receives node:* and relationship:* events.

Verification on the real Windows 11 PC

  • cargo check -p nodespace-app-lib on the PC (workspace copied from this branch; gnu host toolchain, since the msvc toolchain has no link.exe there): finished with exit 0, so the previously cfg'd-out watcher code compiles for Windows (no warnings from watcher.rs). The app-lib library itself does not need libclang; its dev-dependencies (test-support -> daemon -> NLP engine) do, so its tests could not run there. (cargo check against x86_64-pc-windows-msvc was not possible: that target/linker is not installed.)
  • Transport harness: a standalone crate containing the verbatim watch_loop/Pause/pause_after text from watcher.rs (with its 6 unit tests), the verbatim Windows pipe client from grpc_client.rs (pipe_channel_lazy, open_pipe_when_free), the daemon's NamedPipeConn and a minimal in-process NodeService server serving only WatchNodes on a real Named Pipe. Result: the 6 watcher unit tests pass on Windows, and the end-to-end test passed: 3 events (created/updated/deleted with database_id) arrived over the pipe through the tonic channel, the first stream ended cleanly, watch_loop reconnected (2 connections total), 3 more events arrived, and cancelling exited the loop with Ok.

Tests (Mac)

cargo test -p nodespace-app-lib --lib watcher: 11 passed; cargo fmt --check and cargo clippy -p nodespace-app-lib --all-targets -D warnings clean. No new Mac test: the change only widens the cfg, the existing watch-loop tests now run on every platform, so there is nothing to mutate.

What only a full Windows app run could prove

That the real nodespaced.exe (owner-only DACL pipe) and the real app deliver events to the webview on a Windows release build: neither could be built on the PC (no libclang). The harness server stands in for the daemon and does not apply the DACL; the real stream_once (Tauri AppHandle, emit_routed) was only compiled, not run. A Windows CI compile check of this crate is not added here.

🤖 Generated with Claude Code

The watcher already rides the shared GrpcClient, whose default transport is
the Named Pipe on Windows, so nothing in it is Unix specific. Remove the
non-Unix no-op stub and the unix gates on spawn, run, watch_loop and
stream_once, and run the watch-loop unit tests on every platform. The app
now receives node and relationship events on Windows.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 merged commit 03443e9 into main Nov 5, 2026
@mstomar125
mstomar125 deleted the issue-3968-watcher branch November 5, 2026 10:55
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.

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

1 participant