Skip to content

Commit 6595b29

Browse files
Fix check
1 parent 91b0eb5 commit 6595b29

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,10 +1385,19 @@ public void continueAsNew(ContinueAsNewInput input) {
13851385
.determineUseCompatibleFlag(
13861386
replayContext.getTaskQueue().equals(options.getTaskQueue())));
13871387
}
1388-
} else if (replayContext.getRetryOptions() != null) {
1388+
}
1389+
1390+
if (options == null && replayContext.getRetryOptions() != null) {
13891391
// Have to copy certain options as server doesn't copy them.
13901392
attributes.setRetryPolicy(toRetryPolicy(replayContext.getRetryOptions()));
1391-
attributes.setSearchAttributes(replayContext.getSearchAttributes());
1393+
}
1394+
1395+
if (options == null && replayContext.getSearchAttributes() != null) {
1396+
// Carry over existing search attributes if none are specified.
1397+
SearchAttributes existing = replayContext.getSearchAttributes();
1398+
if (existing != null && !existing.getIndexedFieldsMap().isEmpty()) {
1399+
attributes.setSearchAttributes(existing);
1400+
}
13921401
}
13931402

13941403
List<ContextPropagator> propagators =

0 commit comments

Comments
 (0)