authorgravatar for 43361569+m-mohamed@users.noreply.github.comm9d5m <43361569+m-mohamed@users.noreply.github.com> 2026-04-16 16:57:39-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-04-16 16:57:39-07:00
logd90e15d1d7ecba302d6977315977d5c2a748bf36
tree45f3b932c0f281bac38c8d7d4681f58aebe88cd4
parente0117b271a79f66d0ac793da334991e7a2ccb800
signature Signed by PGP key B5690EEEBB952194

fix(server): extend negative repository identity cache ttl (#2083)


2 files changed, 6 insertions(+), 4 deletions(-)

apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts+5-3
......@@ -140,7 +140,7 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
140140 );
141141
142142 it.effect(
143 "refreshes cached null identities after the negative TTL when a remote is configured later",
143 "keeps null identities cached across repeated resolves until the negative TTL expires",
144144 () =>
145145 Effect.gen(function* () {
146146 const fileSystem = yield* FileSystem.FileSystem;
......@@ -156,8 +156,10 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
156156
157157 yield* git(cwd, ["remote", "add", "origin", "git@github.com:T3Tools/t3code.git"]);
158158
159 const cachedIdentity = yield* resolver.resolve(cwd);
160 expect(cachedIdentity).toBeNull();
159 for (const _attempt of [1, 2, 3]) {
160 const cachedIdentity = yield* resolver.resolve(cwd);
161 expect(cachedIdentity).toBeNull();
162 }
161163
162164 yield* TestClock.adjust(Duration.millis(120));
163165
apps/server/src/project/Layers/RepositoryIdentityResolver.ts+1-1
......@@ -68,7 +68,7 @@ function buildRepositoryIdentity(input: {
6868
6969const DEFAULT_REPOSITORY_IDENTITY_CACHE_CAPACITY = 512;
7070const DEFAULT_POSITIVE_CACHE_TTL = Duration.minutes(1);
71const DEFAULT_NEGATIVE_CACHE_TTL = Duration.seconds(10);
71const DEFAULT_NEGATIVE_CACHE_TTL = Duration.minutes(1);
7272
7373interface RepositoryIdentityResolverOptions {
7474 readonly cacheCapacity?: number;