Skip to content

Add RawValue support for non-converted Payloads #1664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

THardy98
Copy link
Contributor

@THardy98 THardy98 commented Apr 1, 2025

What was changed

Added RawValue support for non-converted Payloads - a thin wrapper around Payload.

RawValue is intended to be used for payloads that bypasses users custom payload converters in favour of the default payload converter.

TS does not include type hints or similar when converting from a payload back to its original representation. As such, the best we can do is just send the payload as is and have users convert it back to its original representation.


The existing builtin queries now return a RawValue that wraps their former returned values. The return types of the builtin queries however, maintain their existing type (this is because receivers of these queries will get the payload itself, not the RawValue). This is breaking change as consumers of these builtin queries will need to make sure they decode the builtin payloads correctly.

  1. Closes [Feature Request] Support "RawValue" non-converted values #1629, [Feature Request] Built-in query responses should use "RawValue" #1630

  2. How was this tested:
    Added short integration test, modified the existing built-in metadata test.

  3. Any docs updates needed?
    Possibly. Maybe for the change to the built-in metadata query.

@THardy98 THardy98 requested a review from a team as a code owner April 1, 2025 21:18
@mjameswh
Copy link
Contributor

I believe we need to return RawValue from all built-in queries, not only the user metadata query. And we should be using the default payload converter, not the payload converter provided by the user.

@mjameswh
Copy link
Contributor

I'm really not clear how RawValue should work in TS on the inbound path, given that we don't have any form of type hint on functions that receive Payloads. Using a rawValue payload metadata set on the outbound feels totally wrong to me, as that makes RawValue a symetric thing (i.e. receiver will get a RawValue if and only if the caller sent a RawValue) whereas it seems to me that the reason to have RawPayloads is specifically to support cases where the caller and receiver would have different configurations.

For now, I'd focus on the outbound path only, simply to support return value of built-in queries. For inbound payloads, that might have to wait only we add support for type hints on receivers.

THardy98 added 2 commits July 22, 2025 10:24
…l internal queries

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@THardy98 THardy98 force-pushed the raw_value_support branch from 62de924 to cec9e55 Compare July 22, 2025 21:37
@THardy98 THardy98 force-pushed the raw_value_support branch from cec9e55 to 573c2ca Compare July 22, 2025 21:59
@THardy98 THardy98 requested a review from mjameswh July 23, 2025 15:57
@THardy98
Copy link
Contributor Author

I've written this in the PR description:

The existing builtin queries now return a RawValue that wraps their former returned values. The return types of the builtin queries however, maintain their existing type (this is because receivers of these queries will get the payload itself, not the RawValue). This is breaking change as consumers of these builtin queries will need to make sure they decode the builtin payloads correctly.

Let me know if this makes sense to you.

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.

[Feature Request] Support "RawValue" non-converted values
2 participants