Skip to content

fix: preserve unknown RPC return types - #7168

Open
nanookclaw wants to merge 1 commit into
cloudflare:mainfrom
nanookclaw:fix/rpc-unknown-result
Open

fix: preserve unknown RPC return types#7168
nanookclaw wants to merge 1 commit into
cloudflare:mainfrom
nanookclaw:fix/rpc-unknown-result

Conversation

@nanookclaw

Copy link
Copy Markdown

Summary

Fixes #5200.

Rpc.Result<R> currently falls through to never when R is unknown. The same failure affects concrete object types containing unknown fields, such as { bar: unknown[] }, even though those values can be carried over the RPC boundary.

This adds an unknown extends T branch to Serializable<T>. The guard accepts unknown only when it is the type being checked; known types continue through the existing recursive serializability checks. Existing rejection of known non-serializable values, including ReadableStream<string>, is preserved. Type-level coverage now exercises both the top-level and nested-unknown cases.

Verification

  • git diff --check
  • Focused TypeScript sanity checks against the exact RPC definitions, covering unknown acceptance and ReadableStream<string> rejection.
  • The full Bazel type target was not run because this checkout environment has no Bazel binary or installed repository dependencies.

@nanookclaw
nanookclaw requested a review from a team as a code owner August 28, 2026 13:18
@nanookclaw
nanookclaw requested a review from penalosa August 28, 2026 13:18
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@nanookclaw

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@nanookclaw

Copy link
Copy Markdown
Author

recheck

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.

passing unknown type via an RPC method results in return type resolving to never

1 participant