Commit 2764436
committed
Only set OnConflictOptions when there is a link or callback to attach
The server rejects a StartActivityExecutionRequest whose OnConflictOptions
sets attach_request_id when the request carries neither a link nor a
completion callback (chasm/lib/activity/validator.go's
validateOnConflictOptions: "attach_request_id requires at least one
completion callback or link"). The previous code set attach_request_id and
attach_links unconditionally whenever any Nexus context existed, regardless
of whether the inbound task actually had links -- a bypass-path activity
start issued during an invocation whose inbound Nexus task carries no links
would send exactly that invalid combination and get rejected. This wasn't
caught before because the existing unit tests mock the client and never
exercise real server-side validation.
OnConflictOptions is now only set when there's something to attach, and each
flag reflects what the request actually carries, matching sdk-go's identical
gating in its own fix (temporalnexus/temporal_operation.go, PR #2633). This
also fixes the guarded (metadata-backed) path: it previously set
attach_completion_callbacks based on whether metadata was present rather
than whether a callback URL was actually set, so a guarded start with an
empty callback URL and no links would hit the same rejection.
RootActivityClientInvokerTest: flipped the assertion in
nexusMetadataWithEmptyCallbackUrlOmitsCompletionCallback (attach_completion_
callbacks now correctly reflects the absence of a real callback), rewrote
nexusContextWithoutAmbientStateStartsOrdinaryActivity to assert
OnConflictOptions is entirely absent, and added
metadataWithEmptyCallbackUrlAndNoLinksOmitsOnConflictOptions covering the
previously-untested guarded-call variant of the same bug.1 parent 8fdbb33 commit 2764436
2 files changed
Lines changed: 33 additions & 11 deletions
File tree
- temporal-sdk/src
- main/java/io/temporal/internal/client
- test/java/io/temporal/internal/client
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
140 | 148 | | |
141 | 149 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 150 | + | |
| 151 | + | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
| |||
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
162 | | - | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
151 | 170 | | |
152 | 171 | | |
153 | 172 | | |
| |||
195 | 214 | | |
196 | 215 | | |
197 | 216 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 217 | + | |
201 | 218 | | |
202 | 219 | | |
203 | 220 | | |
| |||
0 commit comments