Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): new Codex runtime entries no longer disable shadow-home providers #23472

Closedjuliusmarmingewants to merge 7 commits intomain fromfix/issue-5817opened View on GitHub

Showing 2 changed files with 152 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
152 additions and 0 deletionsapps/server/src/provider/Drivers/CodexHomeLayout.test.tsModified
View file
@@ -38,6 +38,39 @@
yield* fileSystem.writeFileString(filePath, contents);
});
​
+// Collects real (non-symlink) file contents so data preservation can be asserted without
+// prescribing where a reconciliation keeps or backs up a conflicting shadow entry.
+const readRegularFileContents = Effect.fn("CodexHomeLayout.test.readRegularFileContents")(
+ function* (roots: ReadonlyArray<string>) {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const contents: Array<string> = [];
+ for (const root of roots) {
+ for (const relativePath of yield* fileSystem.readDirectory(root, { recursive: true })) {
+ const entryPath = path.join(root, relativePath);
+ const isSymlink = yield* fileSystem.readLink(entryPath).pipe(
+ Effect.as(true),
+ Effect.orElseSucceed(() => false),
+ );
+ if (isSymlink) continue;
+ const info = yield* fileSystem.stat(entryPath);
+ if (info.type === "File") {
+ contents.push(yield* fileSystem.readFileString(entryPath));
+ }
+ }
+ }
+ return contents;
+ },
+);
+​
+const isSymlink = Effect.fn("CodexHomeLayout.test.isSymlink")(function* (entryPath: string) {