Skip to content

Commit 7dc9917

Browse files
committed
fix(pull-requests): retain strict summary reads
1 parent caa4bdd commit 7dc9917

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎apps/server/src/pullRequest/PullRequestService.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,9 +2966,13 @@ it.effect("shares linked summaries and only recovers transient failures for disp
29662966
],
29672967
});
29682968

2969-
yield* Effect.all([service.summary(reference), service.summary(reference)], {
2970-
concurrency: "unbounded",
2971-
});
2969+
yield* Effect.all(
2970+
[
2971+
service.summary(reference, { recoverTransientFailure: false }),
2972+
service.summary(reference, { recoverTransientFailure: false }),
2973+
],
2974+
{ concurrency: "unbounded" },
2975+
);
29722976
assert.strictEqual(calls, 1);
29732977

29742978
yield* TestClock.adjust("61 seconds");

‎apps/server/src/pullRequest/PullRequestService.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,9 @@ export const make = Effect.gen(function* () {
20482048
const summary: PullRequestService["Service"]["summary"] = (input, options) => {
20492049
const key = refCacheKey(input);
20502050
const cached = Cache.get(summaryCache, key);
2051-
return options?.recoverTransientFailure === false ? cached : lastGoodSummary.read(key, cached);
2051+
return options?.recoverTransientFailure === false
2052+
? cached.pipe(Effect.tap((value) => lastGoodSummary.record(key, value)))
2053+
: lastGoodSummary.read(key, cached);
20522054
};
20532055

20542056
// Keys serialize positionally and parse back in the lookup, so the cache is the only holder

0 commit comments

Comments
 (0)