Skip to content

fix: only set Nexus start on_conflict_options when there's something to attach - #1799

Merged
VegetarianOrc merged 1 commit into
mainfrom
nexus-onconflict-linkless
Sep 1, 2026
Merged

fix: only set Nexus start on_conflict_options when there's something to attach#1799
VegetarianOrc merged 1 commit into
mainfrom
nexus-onconflict-linkless

Conversation

@tekkaya

@tekkaya tekkaya commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What was changed

on_conflict_options on Nexus-context workflow/activity starts is now only set when there are links or callbacks to attach, instead of unconditionally. Server rejects on_conflict_options when no links or callbacks exist to attach.

Why?

Matches sdk-go (and sdk-java's in-progress alignment, temporalio/sdk-java#3048) — the attach flags were previously always enabled even with nothing to attach.

Checklist

  1. Closes N/A, resolves a misalignment between other SDKs on on_conflict_options population in start activity request
  2. Tested: Ran tests/ locally.
  3. Docs: none — private functions only.

@tekkaya
tekkaya force-pushed the nexus-onconflict-linkless branch 2 times, most recently from 4abaa11 to 54278a7 Compare September 1, 2026 00:26
@tekkaya
tekkaya marked this pull request as ready for review September 1, 2026 00:33
@tekkaya
tekkaya requested a review from a team as a code owner September 1, 2026 00:33

@VegetarianOrc VegetarianOrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change seems fine, but a couple questions.

The first is about attaching the request ID. That seems like we might want to attach it on conflict regardless of if there are links and callbacks.

The second is around the rejection of these options by the server. Should it really be rejected if there aren't links/callbacks? Attaching an empty list doesn't seem completely unreasonable. Also these options are sourced from the task delivered in the task by the server so quite a few things would have to go wrong for them to not be present. Either way, the change seems safe enough.

I also think we should get a test in here to prevent regressions around this.

)

if request_links or callbacks:
req.on_conflict_options.attach_request_id = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This option seems like it should be set regardless of if there are links or callbacks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we do have a validation on the standalone activity implementation in chasm, please see: https://github.com/temporalio/temporal/blame/main/chasm/lib/activity/validator.go#L252-L268 and frontend service makes use of that validation here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added tests ptal @VegetarianOrc

…to attach

Matches sdk-go; the attach flags were previously always enabled even
with no links or callbacks to attach, which the server rejects.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tekkaya
tekkaya force-pushed the nexus-onconflict-linkless branch from 54278a7 to 7e61af0 Compare September 1, 2026 17:45
@VegetarianOrc
VegetarianOrc merged commit 619d431 into main Sep 1, 2026
32 of 34 checks passed
@VegetarianOrc
VegetarianOrc deleted the nexus-onconflict-linkless branch September 1, 2026 20:54
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.

2 participants