fix(lambda): list changed durable operations in creation order (#5328)

AWS lists the operations in a checkpoint answer, and the ids in
UpdatedOperationIds, in the order they were created. Floci listed them
in the order they changed, so a step finished after a newer one started,
a wait that fell due, or a chained invoke that failed at once came out
of place.
This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-10-08 22:31:42 -04:00
1 parent c8f16d2484
commit 9c2db353f1
2 files changed
+15 -2

No files matched your search

@@ -34,7 +34,6 @@ import java.nio.charset.StandardCharsets;
import java.time.Clock;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@@ -1035,10 +1034,10 @@ public class DurableExecutionService implements Resettable {
.orElseThrow(() -> new AwsException("ResourceNotFoundException", NOT_FOUND, 404));
}
/** In creation order, as AWS lists them, not in the order they changed. */
private static List<DurableOperation> unseenOperations(DurableExecution execution) {
return execution.getOperations().values().stream()
.filter(operation -> operation.getChangeSequence() > execution.getSeenSequence())
.sorted(Comparator.comparingLong(DurableOperation::getChangeSequence))
.toList();
}