Skip to content

fix(tauri): add path-change subscription parity (#314) - #317

Merged
momics merged 1 commit into
mainfrom
momics-fix-tauri-path-change-parity
Jul 6, 2026
Merged

fix(tauri): add path-change subscription parity (#314)#317
momics merged 1 commit into
mainfrom
momics-fix-tauri-path-change-parity

Conversation

@momics

@momics momics commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Closes #314

Problem

The Tauri adapter was missing nextPathChange / unsubscribePathChanges. Node and Deno implement them, but Tauri fell through to the IrohAdapter base class, so pathChanges() rejected at runtime with nextPathChange() not supported by this adapter, breaking the cross-runtime API-parity promise.

Changes

  • Rust plugin commands (packages/iroh-http-tauri/src/commands.rs): added next_path_change and unsubscribe_path_changes, wired to IrohEndpoint::subscribe_path_changes / unsubscribe_path_changes in iroh-http-core — mirroring the Node (src/lib.rs) and Deno (src/dispatch.rs) adapters (same PathSub + Notify wake-on-unsubscribe pattern). Registered in the plugin builder (lib.rs), build.rs, and granted in the default permission set (permissions/default.toml, plus regenerated autogenerated files).
  • JS binding (guest-js/index.ts): overrode nextPathChange / unsubscribePathChanges using invoke(...), mirroring the existing transport/mDNS methods.
  • Conformance coverage: added a path-change parity test to the shared discovery suite (runs on Node/Deno/Tauri) and a Tauri guest-js IPC test asserting the new commands are invoked and the iterator completes cleanly.

Verification

npm run ci is green end-to-end, including cargo clippy --manifest-path packages/iroh-http-tauri/Cargo.toml -- -D warnings ..., the Tauri Rust tests (incl. the command-list/permission integrity tests), the Tauri guest-js vitest suite, and Node/Deno/interop suites.

No version-field bumps; build-artifact churn (index.js, deno.lock, package-lock.json) reverted.

The Tauri adapter lacked nextPathChange / unsubscribePathChanges, so
pathChanges() fell through to the IrohAdapter base class and rejected at
runtime with "nextPathChange() not supported by this adapter". Node and
Deno already implement these, so this broke the cross-runtime API-parity
promise.

Add Rust plugin commands next_path_change and unsubscribe_path_changes
in commands.rs (wired to IrohEndpoint::subscribe_path_changes /
unsubscribe_path_changes in iroh-http-core, mirroring the Node and Deno
adapters), register them in the plugin builder and build.rs, and grant
them in the default permission set. Override the two methods in the
guest-js TauriAdapter via invoke().

Extend cross-runtime conformance: a path-change parity test in the
shared discovery suite (Node/Deno/Tauri) plus a Tauri guest-js IPC test
asserting the new commands are invoked and the iterator completes.

Closes #314

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@momics
momics merged commit 3766dc5 into main Jul 6, 2026
7 checks passed
@momics
momics deleted the momics-fix-tauri-path-change-parity branch July 20, 2026 08:56
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.

Tauri adapter missing path-change subscription parity (nextPathChange / unsubscribePathChanges)

1 participant