Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): storage cleanup prunes idle No project folders under ~/.t3/scratch #36369

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/36369/headmerged by juliusmarminge View on GitHub

Showing 6 changed files with 82 additions and 2 deletions (loading 3).

x
0 of 6 viewed, 6 left
51 additions and 0 deletionsapps/server/src/orchestration-v2/ProviderTurnStartService.test.tsModified
View file
@@ -320,6 +320,57 @@
}).pipe(Effect.provide(layerRestoreLeaseTest)),
​
+it.each([
+ { label: "directly in the scratch root", folder: "/tmp/t3-home/scratch/notes", recreated: true },
+ { label: "below another folder", folder: "/tmp/t3-home/scratch/notes/deep", recreated: false },
+ {
+ label: "in another project",
+ folder: "/tmp/elsewhere/notes",
+ workspaceRoot: "/tmp/elsewhere",
+ recreated: false,
+ },
+])("recreates a pruned No project folder only $label", async (input) => {
+ const makeDirectory = vi.fn(() => Effect.void);
+ await Effect.gen(function* () {
+ const { restore } = yield* ThreadWorktreeRestore;
+ yield* restore({
+ id: ThreadId.make("thread_scratch_restore"),
+ projectId: ProjectId.make("project_scratch_restore"),
+ worktreePath: input.folder,
+ branch: null,
+ });
+ }).pipe(
+ Effect.provide(
+ layerThreadWorktreeRestore.pipe(
+ Layer.provide(
+ Layer.mergeAll(
+ Layer.succeed(FileSystem.FileSystem, {
+ exists: () => Effect.succeed(false),