Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): PR sync stops reading pull requests closed over a day ago #30071

Mergedadvaitpaliwal(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/30071/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 102 additions and 48 deletions.

x
0 of 2 viewed, 2 left
88 additions and 36 deletionsapps/server/src/orchestration-v2/PullRequestSyncReactor.test.tsModified
View file
@@ -979,6 +979,49 @@
​
+ it.effect("stops reading a pull request a day after it closed, until a refresh asks", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ yield* TestClock.setTime(Date.parse(NOW));
+ const closed = (closedAt: string | null) => ({ state: "closed" as const, closedAt });
+ const fixture = yield* makeHarness({
+ snapshot: makeSnapshot([
+ makeThread("closed", {
+ pullRequests: [
+ makeLink(1, closed("2026-08-20T00:00:00.000Z")),
+ makeLink(2, closed("2026-08-26T00:00:00.000Z")),
+ makeLink(3, closed("2026-08-28T11:00:00.000Z")),
+ makeLink(4, closed(null)),
+ ],
+ }),
+ ]),
+ summary: (input) =>
+ Effect.succeed(makeSummary(input, { state: "closed", closedAt: NOW })),
+ });
+ const reads = Ref.get(fixture.summaryCalls).pipe(
+ Effect.map((calls) => calls.map((call) => call.number).toSorted()),
+ );
+​
+ yield* Effect.gen(function* () {
+ const reactor = yield* startAndSweep(fixture);
+ // Closed within the day, or with no close time, keeps the fifteen-minute cadence.