Skip to content

Commit 004e986

Browse files
ericallamclaude
andcommitted
Fix sort comparators to return 0 for equal values
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c22c2cf commit 004e986

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/webapp/app/services/runsReplicationService.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ export class RunsReplicationService {
602602
}
603603
const aRunId = a[TASK_RUN_INDEX.run_id] as string;
604604
const bRunId = b[TASK_RUN_INDEX.run_id] as string;
605+
if (aRunId === bRunId) return 0;
605606
return aRunId < bRunId ? -1 : 1;
606607
});
607608

@@ -613,6 +614,7 @@ export class RunsReplicationService {
613614
.sort((a, b) => {
614615
const aRunId = a[PAYLOAD_INDEX.run_id] as string;
615616
const bRunId = b[PAYLOAD_INDEX.run_id] as string;
617+
if (aRunId === bRunId) return 0;
616618
return aRunId < bRunId ? -1 : 1;
617619
});
618620

0 commit comments

Comments
 (0)