Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): first pull request open no longer fails as interrupted #14122

Closedwhoisaldo(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/14122/headopened View on GitHub

Showing 3 changed files with 93 additions and 21 deletions.

x
0 of 3 viewed, 3 left
12 additions and 21 deletionsapps/server/src/pullRequest/PullRequestService.tsModified
View file
@@ -5,7 +5,6 @@
} from "@t3tools/shared/sourceControl";
import { normalizeGitRemoteUrl } from "@t3tools/shared/git";
import * as Cache from "effect/Cache";
-import * as Cause from "effect/Cause";
import * as Clock from "effect/Clock";
import * as Context from "effect/Context";
import * as DateTime from "effect/DateTime";
@@ -83,6 +82,7 @@
import * as RepositoryIdentityResolver from "../project/RepositoryIdentityResolver.ts";
import * as SourceControlProviderRegistry from "../sourceControl/SourceControlProviderRegistry.ts";
import * as SourceControlRateLimit from "../sourceControl/SourceControlRateLimit.ts";
+import { getCached } from "../utils/getCached.ts";
import {
type ProviderChangeRequest,
type ProviderListCursor,
@@ -1077,13 +1077,13 @@
// roots are the same lookup, and putting them on separate flights would spawn two of
// this host's CLIs on a cold page load, which is the coalescing this exists for.
const key = JSON.stringify([host, api.kind, [...new Set(roots)].sort()]);
- if (options?.allowPaused === true) return Cache.get(viewerFlights, key);
+ if (options?.allowPaused === true) return getCached(viewerFlights, key);
// The pause is checked here rather than inside the lookup, so that it holds back the
// callers nobody is waiting on without splitting the flight they share with a press.
// A failed lookup is held nowhere, so letting a background read through would spawn
// this host's CLI on every refresh for as long as the pause lasted, and re-extend it.
return rateLimits.check({ provider: api.kind, host }).pipe(
- Effect.flatMap(() => Cache.get(viewerFlights, key)),