Skip to content

Conversation

cretz
Copy link
Member

@cretz cretz commented Sep 24, 2025

What was changed

Previously, we applied context-based codecs/converters to everything a workflow does, and then if a workflow also did anything needing more context (e.g. activity or child workflow calls), we applied a context on top of that. Per #523, this was an incorrect approach. We need to apply contexts only in serialization/deserialization situations where the exact same context can be applied on the other side with deserialization/serialization.

There are no test adjustments for this PR because the test coverage from #446 still applies, this just affects the edge case of stacking the codecs/converters.

This is a 💥 breaking change technically because in situations where we used a specific context on top of outer-workflow context before (e.g. working with activity or child), we only apply the specific context now instead. This will only affect users with custom codecs/converters that support serialization contexts and built an expectation on the workflow-context one to be used for everything in a workflow.

Checklist

  1. Closes [Bug] Serialization context incorrectly applied to all workflow calls #523
  2. Closes [Feature Request] Ensure tests exist to confirm custom slot supplier slot info has proper fields #519

@cretz cretz requested a review from a team as a code owner September 24, 2025 15:17
@dandavison
Copy link
Contributor

dandavison commented Sep 24, 2025

There are no test adjustments for this PR because the test coverage from #446 still applies, this just affects the edge case of stacking the codecs/converters.

In Python I'm adding a test that demonstrates that every key in the context on the outbound side is available for decryption in the corresponding context on the inbound side, for a kitchen-sink-ish workflow. I'm not suggesting that's necessary to add here. But seeing as this PR does fix a genuine issue, it could be good to have a test that proves that an outbound Nexus payload now lacks any context and hence context cannot be used to encrypt in an un-decryptable way.

@cretz
Copy link
Member Author

cretz commented Sep 24, 2025

👍 I adjusted the .NET kichen-sink-ish converter context test to check that Nexus is contextless (the first contextless use of a converter in workflows, so had to adjust a bit).

Copy link
Contributor

@maciejdudko maciejdudko left a comment

Choose a reason for hiding this comment

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

Looks good! We should add an issue link to TODO comments for Nexus serialization context (and create issue if we haven't yet) but even without that, it's ready to merge. LGTM!

}
break;
case WorkflowActivationJob.VariantOneofCase.ResolveNexusOperation:
// TODO(cretz): Support Nexus serialization context
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add issue link for Nexus serialization context

Copy link
Member Author

@cretz cretz Sep 25, 2025

Choose a reason for hiding this comment

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

Yeah, arguably this shouldn't be a TODO, more of a "here is where you'd add it". We do not support Nexus serialization context at this time in SDKs and not sure when we will (it's not really a bug, we may never).

break;
case WorkflowActivationJob.VariantOneofCase.ResolveNexusOperationStart:
if (job.ResolveNexusOperationStart.Failed != null)
// TODO(cretz): Support Nexus serialization context
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add issue link for Nexus serialization context

@cretz cretz merged commit f99bca3 into temporalio:main Sep 25, 2025
10 checks passed
@cretz cretz deleted the serialization-context-fixes branch September 26, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants