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 1 commit 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 normal payload conversion. It uses the presence of the METADATA_RAW_VALUE_KEY in its payload's metadata to determine if the payload bypasses normal payload conversion or not.

It has a minimal API, useful for custom data converters that use RawValue, including:

  • send: to be used when sending the RawValue to the server (i.e. toPayload)

send adds metadata to its payload that identifies it as a RawValue.
This metadata (METADATA_RAW_VALUE_KEY) is used to check whether a payload is a RawValue on arrival.

This metadata should be checked before you...

  • receive: to be used a payload you expect to be a RawValue from the server (i.e. fromPayload)

receive strips the raw value metadata and constructs a RawValue

This is a different approach to how this was implemented in other SDKs as TS does not include type hints or similar when converting from a payload back to its original representation. As such, we use the payload metadata to give us a hint.


Also modified the existing built-in metadata query to return a RawValue (formerly returned the metadata proto object). This is not backwards compatible, existing users of this query (principally UI and CLI) will need to convert the payload from the RawValue (see example in the test).

  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
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
1 participant