Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop a dying pull request cache entry from failing the read (#14113) #14162

ClosedDeryFerd(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/14162/headopened View on GitHub

Showing 2 changed files with 109 additions and 6 deletions.

x
0 of 2 viewed, 2 left
71 additions and 0 deletionsapps/server/src/pullRequest/PullRequestService.test.tsModified
View file
@@ -4,6 +4,7 @@
import { assert, it } from "@effect/vitest";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
+import * as Exit from "effect/Exit";
import * as Fiber from "effect/Fiber";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
@@ -263,6 +264,76 @@
}),
​
+it.effect("reads a detail again when the cache answers with an interrupt", () =>
+ Effect.gen(function* () {
+ let calls = 0;
+ const service = yield* makeService({
+ projects: [project({ id: "p1", title: "web", workspaceRoot: "/w", repository: "acme/web" })],
+ providers: [
+ fakeProvider("github", {
+ getChangeRequest: () => {
+ calls += 1;
+ return calls === 1
+ ? Effect.interrupt
+ : Effect.succeed(hostedChangeRequest("Description"));
+ },
+ }),
+ ],
+ });
+ const ref = { projectId: "p1" as ProjectId, repository: "acme/web", number: 1 };