Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): PR status comes back sooner after a branch switch #28577

OpenYuruzuu(GitHub profile, opens in a new tab)wants to merge 16 commits intomain fromrefs/pull/28577/headopened View on GitHub

Showing 5 changed files with 72 additions and 12 deletions (loading 2).

x
0 of 5 viewed, 5 left
41 additions and 2 deletionsapps/server/src/git/GitManager.test.tsModified
View file
@@ -1161,7 +1161,10 @@
- it.effect("a git read in flight during a T3 git action does not outlive it", () =>
+ it.effect.each([
+ { action: "a T3 git action", options: undefined },
+ { action: "a checkout", options: { keepPullRequestLookups: true } },
+ ])("a git read in flight during $action does not outlive it", ({ options }) =>
Effect.gen(function* () {
const repoDir = yield* makeTempDir("t3code-git-manager-");
yield* initRepo(repoDir);
@@ -1204,7 +1207,7 @@
const inFlight = yield* Effect.forkChild(lookup);
yield* Deferred.await(gate.reached);
yield* runGit(repoDir, ["branch", "--set-upstream-to=origin/feature/raced-head"]);
- yield* manager.invalidateStatus(repoDir);
+ yield* manager.invalidateStatus(repoDir, options);
yield* Deferred.succeed(gate.release, undefined);
yield* Fiber.join(inFlight);
@@ -3550,6 +3553,42 @@
+ it.effect("a checkout's invalidation keeps the branch's cached PR lookup", () =>
+ Effect.gen(function* () {
+ const repoDir = yield* makeTempDir("t3code-git-manager-");