Skip to content

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

Description

@momics

Summary

The Tauri adapter does not implement path-change subscriptions, breaking the cross-runtime API parity that is the core promise of this package. nextPathChange() on Tauri falls through to the IrohAdapter base class and rejects with "nextPathChange() not supported by this adapter." Node and Deno both implement it.

Evidence

Verified against the current tree:

Capability Node Deno Tauri
nextPathChange / unsubscribePathChanges packages/iroh-http-node/lib.ts:402-411 packages/iroh-http-deno/src/adapter.ts:1558-1568 ❌ not overridden (class ends guest-js/index.ts:385)
  • No Rust command exists either: grep for next_path_change / path_change / unsubscribe_path across packages/iroh-http-tauri returns zero matches — the gap is both JS binding and plugin command.
  • Base-class default that gets hit: packages/iroh-http-shared/src/IrohAdapter.ts:235-242 (nextPathChange rejects; unsubscribePathChanges is a no-op).

Note: mDNS and transport events ARE implemented on all three adapters — this is the only genuine cross-runtime capability gap. (drainTransportEvents defaulting to no-op on Node/Tauri is correct by design — only Deno runs a JS polling loop.)

Impact

A Tauri app cannot subscribe to peer path changes at all, silently diverging from Node/Deno. Because the base class default-throws, this compiles cleanly and only fails at runtime in a downstream app — the parity gap is invisible until called.

Remediation

  1. Add a next_path_change (+ unsubscribe_path_changes) command to the Tauri plugin (packages/iroh-http-tauri/src/commands.rs + permissions), wiring to the same core path-change subscription Node/Deno use.
  2. Override nextPathChange / unsubscribePathChanges in packages/iroh-http-tauri/guest-js/index.ts.
  3. Add path-change coverage to the cross-runtime conformance suite so Tauri is exercised alongside Node/Deno.

Secondary consideration (from architecture review)

This gap went unnoticed because IrohAdapter exposes cross-platform capabilities as default-throwing stubs rather than enforced contract. Once Tauri path-change lands, consider promoting these truly-universal capabilities (mDNS, transport events, path changes) from default-throwing base methods to abstract methods, so a future missing override is a compile-time failure rather than a runtime throw in a user's app. The broader "narrow the interface into capability seams" idea from the review is not warranted — parity is otherwise complete — but making universal capabilities compiler-enforced is a cheap guard against recurrence.

Acceptance criteria

  • Tauri implements nextPathChange and unsubscribePathChanges (JS + Rust command + permission).
  • Behaviour matches Node/Deno (same subscribe/return/unsubscribe semantics).
  • Cross-runtime conformance suite exercises path changes on all three adapters.
  • npm run ci green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions