File tree Expand file tree Collapse file tree
temporal-sdk/src/main/java/io/temporal/internal/sync Expand file tree Collapse file tree Original file line number Diff line number Diff 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 =
You can’t perform that action at this time.
0 commit comments