mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-07 17:04:42 +00:00
fix: preserve workspace recovery contracts
This commit is contained in:
@@ -1494,14 +1494,7 @@ export const WorkspaceRecoveryStateSchema = z.discriminatedUnion("kind", [
|
||||
z.object({
|
||||
kind: z.literal("unavailable"),
|
||||
workspaceId: z.string(),
|
||||
reason: z.enum([
|
||||
"workspace_not_found",
|
||||
"workspace_not_archived",
|
||||
"project_not_found",
|
||||
"project_directory_missing",
|
||||
"workspace_directory_missing",
|
||||
"worktree_branch_missing",
|
||||
]),
|
||||
reason: z.string(),
|
||||
message: z.string(),
|
||||
}),
|
||||
]);
|
||||
|
||||
@@ -83,4 +83,28 @@ describe("workspace recovery protocol", () => {
|
||||
}).features?.workspaceRecovery,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test("accepts unavailable reasons added by newer daemons", () => {
|
||||
expect(
|
||||
SessionOutboundMessageSchema.parse({
|
||||
type: "workspace.recovery.inspect.response",
|
||||
payload: {
|
||||
requestId: "inspect-future",
|
||||
state: {
|
||||
kind: "unavailable",
|
||||
workspaceId: "workspace-1",
|
||||
reason: "future_recovery_constraint",
|
||||
message: "This host cannot recover the workspace yet.",
|
||||
},
|
||||
},
|
||||
}),
|
||||
).toMatchObject({
|
||||
payload: {
|
||||
state: {
|
||||
kind: "unavailable",
|
||||
reason: "future_recovery_constraint",
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user