Skip to content

Feature/serialization context2 - #796

Draft
xepozz wants to merge 2 commits into
masterfrom
feature/serialization-context2
Draft

Feature/serialization context2#796
xepozz wants to merge 2 commits into
masterfrom
feature/serialization-context2

Conversation

@xepozz

@xepozz xepozz commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

What was changed

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

xepozz added 2 commits August 17, 2026 15:50
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
xepozz force-pushed the feature/serialization-context2 branch from 1378460 to a65112b Compare August 17, 2026 11:51
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.

1 participant