Skip to content
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

fix: workflow input decoding #1821

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

octonato
Copy link
Member

@github-actions github-actions bot added java-sdk-protobuf kalix-runtime Runtime and SDKs sub-team labels Oct 25, 2023
Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@octonato octonato merged commit 0d7c344 into main Oct 25, 2023
65 checks passed
@octonato octonato deleted the octonato/fix-view-result-deser-in-workflows branch October 25, 2023 15:52
// if that's the case, we need to patch the message using the typeUrl from the expected input class
private def decodeInput(messageCodec: MessageCodec, result: ScalaPbAny, expectedInputClass: Class[_]) =
if (result.typeUrl == JsonSupport.KALIX_JSON + "object") {
val typeUrl = messageCodec.typeUrlFor(expectedInputClass)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that work when the workflow queries the view, and the view itself was not used yet, so the messaceCodec might not have the expectedInputClass entry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input classes are registered in the messageCodec when we register the component. And that's valid for all components. So, the answer is yes.

The problem here is that we were always relying on the incoming typeUrl which is simply not reliable enough in this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java-sdk-protobuf kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants