Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/allow-channel-reuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@fltsci/taurpc": patch
---

Allow `Channel`s to be reused across multiple TauRPC command invocations.

Previously, when a command argument contained a `Channel<T>` and the runtime ran a transform pass (e.g. semantic-types decoding), the generated TS proxy mutated the original channel's `onmessage` handler in place. Passing the same channel to a second command (or any code path that re-invoked the proxy) would re-wrap the already-wrapped handler, double-decoding payloads.

The proxy now wraps via `new Channel((response) => v.onmessage(transform(response)))` instead of mutating, so the original channel is untouched and safe to reuse.

Generated bindings now import `Channel` from `@tauri-apps/api/core` whenever the affected transform path is reachable.
Loading