Repository navigation
Remove nil search attributes from history events / mutable state / ch… - #9091
Merged
Merged
Conversation
awln-temporal
force-pushed
the
remove-nil-search-attributes
branch
from
January 21, 2026 19:23
4d9aa43 to
f71cea1
Compare
rodrigozhou
requested changes
Jan 22, 2026
awln-temporal
force-pushed
the
remove-nil-search-attributes
branch
from
January 27, 2026 22:05
d75bf9d to
f5d204a
Compare
yycptt
reviewed
Jan 27, 2026
cretz
reviewed
Jan 28, 2026
awln-temporal
force-pushed
the
remove-nil-search-attributes
branch
from
February 19, 2026 23:15
97f1346 to
f5fc7dd
Compare
rodrigozhou
reviewed
Feb 23, 2026
awln-temporal
force-pushed
the
remove-nil-search-attributes
branch
from
February 26, 2026 17:53
6201cf4 to
409c692
Compare
rodrigozhou
reviewed
Mar 18, 2026
Comment on lines
+486
to
+489
| // Filter nil values here rather than in the API layer because not all | ||
| // creation paths go through the frontend (continue-as-new, child workflows, replication). | ||
| Memo: payload.FilterNilMemo(command.Memo), | ||
| SearchAttributes: payload.FilterNilSearchAttributes(command.SearchAttributes), |
Contributor
There was a problem hiding this comment.
This event is added to the source workflow. Please update the comment accordingly.
Comment on lines
+855
to
+858
| // Filter nil values here rather than in the API layer because not all | ||
| // creation paths go through the frontend (continue-as-new, child workflows, replication). | ||
| Memo: payload.FilterNilMemo(command.Memo), | ||
| SearchAttributes: payload.FilterNilSearchAttributes(command.SearchAttributes), |
rodrigozhou
approved these changes
Mar 30, 2026
chaptersix
pushed a commit
that referenced
this pull request
Apr 2, 2026
#9091) ## What changed? Remove nil search attributes from history events / mutable state / chasm node ## Why? Search attributes can be explicitly set as null on the following events: * Workflow Start * Upsert Search Attributes * Continue-as-new Starting a workflow or continuing a workflow as new with a nil search attribute records the `{key: nil}` mapping in mutable state and the history event. Upserting search attributes erases any current search attribute value from persistence (mutable state and visibility record). Upserting the search attribute as nil in the SDK retains the mapping in the WorkflowInfo as a {key: nil} mapping. On a continue-as-new event, SDK sends this mapping to Server, and the search attribute gets repopulated with the null search attribute in the history event and mutable state. This last scenario can cause inconsistency between the expected search attributes and what is recorded in history. After upserting a nil search attribute, the mutable state and visibility record no longer shows this search attribute. But, once continuing as new, the search attribute reappears, leading to unexpected NDE if the search attribute is also deregistered. ## CHASM change This also removes nil search attributes from CHASM nodes on replacement. This mirrors the change to Workflow History Events and Mutable State. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [X] added new functional test(s)
xepozz
added a commit
to temporalio/sdk-php
that referenced
this pull request
Oct 21, 2026
#836) Server 1.31 (temporalio/temporal#9091) drops an empty search attribute map from the start event, so the child workflow gets null for []. Run the tests on CLI 1.9 (Server 1.32).
xepozz
added a commit
to temporalio/sdk-php
that referenced
this pull request
Oct 21, 2026
* test: accept null for empty search attributes on Temporal Server 1.31+ Server 1.31 (temporalio/temporal#9091) drops an empty search attribute map from the start event, so the child workflow gets null for []. Run the tests on CLI 1.9 (Server 1.32). * feat: add WorkerOptions::$disablePayloadErrorLimit The RoadRunner worker fails the Workflow Task with PAYLOADS_TOO_LARGE when a payload exceeds the namespace limit. The option turns this check off.
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 changed?
Remove nil search attributes from history events / mutable state / chasm node
Why?
Search attributes can be explicitly set as null on the following events:
Workflow Start
Upsert Search Attributes
Continue-as-new
Starting a workflow or continuing a workflow as new with a nil search attribute records the
{key: nil}mapping in mutable state and the history event.Upserting search attributes erases any current search attribute value from persistence (mutable state and visibility record).
Upserting the search attribute as nil in the SDK retains the mapping in the WorkflowInfo as a {key: nil} mapping. On a continue-as-new event, SDK sends this mapping to Server, and the search attribute gets repopulated with the null search attribute in the history event and mutable state.
This last scenario can cause inconsistency between the expected search attributes and what is recorded in history. After upserting a nil search attribute, the mutable state and visibility record no longer shows this search attribute. But, once continuing as new, the search attribute reappears, leading to unexpected NDE if the search attribute is also deregistered.
CHASM change
This also removes nil search attributes from CHASM nodes on replacement. This mirrors the change to Workflow History Events and Mutable State.
How did you test it?