Skip to content

Commit 5324e7d

Browse files
committed
fix(server): settled links refresh when the shared PR is final elsewhere
1 parent 81613f6 commit 5324e7d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/server/src/orchestration-v2/PullRequestSyncReactor.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,11 @@ describe("PullRequestSyncReactor", () => {
12681268
makeLink(7, { state: "merged", mergedAt: "2026-08-20T00:00:00.000Z" }),
12691269
],
12701270
}),
1271+
makeThread("active", {
1272+
pullRequests: [
1273+
makeLink(5, { state: "merged", mergedAt: "2026-08-20T00:00:00.000Z" }),
1274+
],
1275+
}),
12711276
]),
12721277
});
12731278
const readNumbers = Effect.map(Ref.getAndSet(fixture.summaryCalls, []), (calls) =>

‎apps/server/src/orchestration-v2/PullRequestSyncReactor.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,9 @@ export const make = Effect.gen(function* () {
364364
nowMs - Date.parse(snapshot.closedAt ?? "") >= CLOSED_FINAL_AFTER_MS;
365365
const last = lastSyncedAt.get(key);
366366
const sinceLastMs = last === undefined ? Number.POSITIVE_INFINITY : nowMs - last;
367-
if (active.length === 0) {
367+
if (active.every(isFinal)) {
368368
return !entries.every(isFinal) && sinceLastMs >= SETTLED_SYNC_INTERVAL_MS;
369369
}
370-
if (active.every(isFinal)) return false;
371370
const open = active.filter((entry) => entry.link.snapshot?.state === "open");
372371
if (open.length > 0) {
373372
const quiet = open.every((entry) => {

0 commit comments

Comments
 (0)