Avoid sensitive persistence paths
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
ff76f76de1
commit
3b109689e1
3 files changed
+2
-23
No files matched your search
@@ -340,7 +340,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "read",
|
||||
resource: "shell-cache",
|
||||
environmentId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -352,7 +351,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "parse",
|
||||
resource: "shell-cache",
|
||||
environmentId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -364,7 +362,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "decode",
|
||||
resource: "shell-cache",
|
||||
environmentId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
@@ -386,7 +383,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "read",
|
||||
resource: "legacy-shell-cache",
|
||||
environmentId,
|
||||
path: legacyFile.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -398,7 +394,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "parse",
|
||||
resource: "legacy-shell-cache",
|
||||
environmentId,
|
||||
path: legacyFile.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -410,7 +405,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "decode",
|
||||
resource: "legacy-shell-cache",
|
||||
environmentId,
|
||||
path: legacyFile.uri,
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
@@ -435,7 +429,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "encode",
|
||||
resource: "shell-cache",
|
||||
environmentId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
@@ -453,7 +446,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "write",
|
||||
resource: "shell-cache",
|
||||
environmentId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -473,7 +465,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
threadId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -486,7 +477,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
threadId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -499,7 +489,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
threadId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
@@ -525,7 +514,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
threadId: thread.id,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
@@ -544,7 +532,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
threadId: thread.id,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -562,7 +549,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
threadId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -580,7 +566,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "remove",
|
||||
resource: "shell-cache",
|
||||
environmentId,
|
||||
path: file.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -595,7 +580,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "remove",
|
||||
resource: "legacy-shell-cache",
|
||||
environmentId,
|
||||
path: legacyFile.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
@@ -613,7 +597,6 @@ export const connectionStorageLayer = Layer.effectContext(
|
||||
stage: "remove",
|
||||
resource: "thread-cache",
|
||||
environmentId,
|
||||
path: threadDirectory.uri,
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -17,13 +17,12 @@ describe("ConnectionPersistenceError", () => {
|
||||
resource: "thread-cache",
|
||||
environmentId: EnvironmentId.make("environment-1"),
|
||||
threadId: ThreadId.make("thread-1"),
|
||||
path: "file:///cache/thread-1.json",
|
||||
cause,
|
||||
});
|
||||
|
||||
expect(error.cause).toBe(cause);
|
||||
expect(error.message).toBe(
|
||||
"Could not load thread: thread cache decode failed for environment environment-1 and thread thread-1 at file:///cache/thread-1.json.",
|
||||
"Could not load thread: thread cache decode failed for environment environment-1 and thread thread-1.",
|
||||
);
|
||||
expect(error.message).not.toContain(cause.message);
|
||||
});
|
||||
|
||||
@@ -51,7 +51,6 @@ export class ConnectionPersistenceError extends Schema.TaggedErrorClass<Connecti
|
||||
]),
|
||||
environmentId: Schema.optionalKey(EnvironmentId),
|
||||
threadId: Schema.optionalKey(ThreadId),
|
||||
path: Schema.optionalKey(Schema.String),
|
||||
cause: Schema.Defect(),
|
||||
},
|
||||
) {
|
||||
@@ -61,7 +60,6 @@ export class ConnectionPersistenceError extends Schema.TaggedErrorClass<Connecti
|
||||
readonly resource: ConnectionPersistenceError["resource"];
|
||||
readonly environmentId?: EnvironmentId;
|
||||
readonly threadId?: ThreadId;
|
||||
readonly path?: string;
|
||||
readonly cause: ConnectionTransientError;
|
||||
}) {
|
||||
const { cause, fallbackStage, ...attributes } = input;
|
||||
@@ -105,8 +103,7 @@ export class ConnectionPersistenceError extends Schema.TaggedErrorClass<Connecti
|
||||
const environment =
|
||||
this.environmentId === undefined ? "" : ` for environment ${this.environmentId}`;
|
||||
const thread = this.threadId === undefined ? "" : ` and thread ${this.threadId}`;
|
||||
const path = this.path === undefined ? "" : ` at ${this.path}`;
|
||||
return `Could not ${this.operation.replaceAll("-", " ")}: ${this.resource.replaceAll("-", " ")} ${this.stage} failed${environment}${thread}${path}.`;
|
||||
return `Could not ${this.operation.replaceAll("-", " ")}: ${this.resource.replaceAll("-", " ")} ${this.stage} failed${environment}${thread}.`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user