Skip to content

Tweaking some NexusSerializationContext behavior - #3104

Closed
Evanthx wants to merge 1 commit into
mainfrom
serialization_tweak
Closed

Evanthx wants to merge 1 commit into
mainfrom
serialization_tweak

Conversation

@Evanthx

@Evanthx Evanthx commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Coming from PR comments in temporalio/sdk-dotnet#908 and from something I found in a code review. It is a follow-up to PRs #3075 and #3084.

These are issues in the original PR this was modeled from so needs to get spread back to the other SDKs.

The change looks big but really isn't - cleaned up comments, and changed how some things are being passed around, but those just touched a good handful of places.

                                                                                                                                                                                                                                                                             Changes                                                                                                                                                                                                                                                                         

Breaking (experimental API): NexusClientCallsInterceptor.GetNexusOperationResultInput now takes a single nullable NexusSerializationContext instead of separate endpoint, service and operation strings. getSerializationContext() replaces getEndpoint(), getService() and getOperation(). The three values could be set independently, which needed a runtime all-or-nothing check. With one context, a partially set result input can no longer be built. NexusOperationHandleImpl now stores one context, and UntypedNexusServiceClientImpl.start builds it once for both the input payload and the handle.

Fix: with the use-existing ID conflict policy, the server can return an already-running operation that was started with a different endpoint, service or operation than the request names. The handle used to take its context from the request, so it decoded results under the wrong context. When the start response reports started=false, the client now describes the operation and uses the endpoint, service and operation from the description.

Comments: removed doc comments that promised downstream decoding behavior. Also fixed a wrong comment on NexusTaskHandler.Result: servers before 1.30 give a context with an empty endpoint, not a null context.

@Evanthx
Evanthx requested a review from a team as a code owner September 30, 2026 21:14
@Evanthx Evanthx closed this Sep 30, 2026
@Evanthx
Evanthx deleted the serialization_tweak branch September 30, 2026 21:33
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