Feature/serialization context2 - #796
Draft
xepozz wants to merge 2 commits into
Draft
Conversation
Add SerializationContext support so a payload converter or failure converter can know which namespace, workflow, or activity a payload belongs to: - SerializationContext marker with WorkflowSerializationContext and ActivitySerializationContext, plus SerializationContextAwareInterface and SerializationContextApplier for opt-in context binding. - Outbound workflow context is resolved at a single choke point in WorkflowContext::request per command type (activity, local activity, child workflow, external signal, complete, side effect, continue-as-new); stubs create plain EncodedValues and carry no context. - Inbound routers, client API (start, signal-with-start, update-with-start, query, update, result), start memo, schedule mapping, pending activity info, heartbeat details, and failure chains are converted with the proper context. - ActivityCompletionClient stays context-free by default with an explicit withContext escape hatch for out-of-band completion. Covered by unit tests and an acceptance suite that signs every payload with its serialization context and rejects any mismatch.
…ibutes Add an opt-in FeatureFlags::$encodeFailureAttributes switch that moves the failure message and stack trace into the encoded_attributes payload, replacing the plain fields with 'Encoded failure' and an empty stack trace. The payload goes through the Data Converter, so a custom converter or codec can encrypt data that would otherwise travel in clear text. Causes are encoded recursively. Encoded attributes are always decoded back, regardless of the flag, so a worker that does not enable it still understands failures produced by one that does. The encoded attributes are converted with the failure serialization context; a failure response carries no payloads, so the context is taken from the exception itself when the caller has none. Decoding is tolerant: the wire decoder maps failures before the context is known, and a context-aware converter may refuse the payload there.
xepozz
force-pushed
the
feature/serialization-context2
branch
from
August 17, 2026 11:51
1378460 to
a65112b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
Why?
Checklist
Closes
How was this tested: