Skip to content

Tauri plugin: commands missing from build.rs have no permission (start_transport_events, session_accept, try_next_chunk) #248

Description

@momics

Summary

Three Tauri commands are wired into the plugin's tauri::generate_handler![...] but are missing from the build.rs command list, so Tauri never generates an allow-* permission for them. They cannot be granted by any capability and fail at runtime with:

iroh-http.start_transport_events not allowed. Command not found

Affected commands:

Command Breaks
start_transport_events All transport / path-change observability (fires on every createNode)
session_accept Accepting incoming QUIC sessions (server side of iroh-http:connect)
try_next_chunk Fast-path body reads used by fetch and serve streaming

Evidence

packages/iroh-http-tauri/src/lib.rs registers all three in invoke_handler, but packages/iroh-http-tauri/build.rs Builder::new(&[...]) omits them. Tauri's permission generation is driven by build.rs, so no allow-start-transport-events, allow-try-next-chunk permission existed, and allow-session-accept only resolved via a stale autogenerated file (a clean rebuild would have removed it).

Additionally, even once generated, try_next_chunk and start_transport_events were not referenced by any permission set, so a capability could not enable them.

Impact

  • node observability (path changes / diagnostics) is dead in the Tauri plugin — every createNode() logs start_transport_events not allowed. Command not found.
  • Incoming session acceptance is fragile (works only by stale-file accident).
  • Fast-path body streaming is unreachable.

This is the same "ACL drift invisible to the build" class as #246 (permission sets declared as [[permission]]). The build stays green because Tauri fails open / silently, and no test exercised command↔permission parity.

Remediation

  1. Add try_next_chunk, session_accept, start_transport_events to build.rs so leaf permissions are generated.
  2. Add allow-try-next-chunk to the fetch and serve sets; add allow-start-transport-events to [default] (it fires on createNode). allow-session-accept is already in the connect set.
  3. Regenerate permissions/autogenerated/ and permissions/schemas/schema.json.
  4. Add a regression guard (extends tests/permissions.rs) asserting parity between generate_handler!, build.rs, and the permission sets — so a registered command without a generated, granted permission fails CI.

Acceptance criteria

  • generate_handler!, build.rs, and the permission sets list the identical command set (asserted by a test).
  • Every generated command is granted by a [[set]] or [default] (asserted by a test).
  • Enabling transport events / accepting sessions / fast-path body reads no longer fails with "Command not found".
  • cargo test -p tauri-plugin-iroh-http --test permissions passes; cargo clippy -- -D warnings clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High prioritybugSomething isn't workingdxDeveloper experiencerustPull requests that update rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions