From 369b46ea080038570ddfd032f2778e3a31773b26 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 14 Apr 2026 06:26:38 +0700 Subject: [PATCH] Fix e2e helpers: workspace IDs are strings, not numbers After removing SQLite, workspace IDs are cwd path strings instead of numeric database IDs. Update type declarations in workspace-setup.ts and terminal-perf.ts, and remove the numeric parsing in fetchWorkspaceById that would reject path-based IDs. --- packages/app/e2e/helpers/terminal-perf.ts | 2 +- packages/app/e2e/helpers/workspace-setup.ts | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/app/e2e/helpers/terminal-perf.ts b/packages/app/e2e/helpers/terminal-perf.ts index aeab46838..c254af53d 100644 --- a/packages/app/e2e/helpers/terminal-perf.ts +++ b/packages/app/e2e/helpers/terminal-perf.ts @@ -9,7 +9,7 @@ export type TerminalPerfDaemonClient = { connect(): Promise; close(): Promise; openProject(cwd: string): Promise<{ - workspace: { id: number; name: string; projectRootPath: string } | null; + workspace: { id: string; name: string; projectRootPath: string } | null; error: string | null; }>; createTerminal( diff --git a/packages/app/e2e/helpers/workspace-setup.ts b/packages/app/e2e/helpers/workspace-setup.ts index ebc7ca1d0..37dd71406 100644 --- a/packages/app/e2e/helpers/workspace-setup.ts +++ b/packages/app/e2e/helpers/workspace-setup.ts @@ -13,7 +13,7 @@ type WorkspaceSetupDaemonClient = { close(): Promise; openProject(cwd: string): Promise<{ workspace: { - id: number; + id: string; name: string; workspaceDirectory: string; projectRootPath: string; @@ -22,7 +22,7 @@ type WorkspaceSetupDaemonClient = { }>; createPaseoWorktree(input: { cwd: string; worktreeSlug?: string }): Promise<{ workspace: { - id: number; + id: string; name: string; workspaceDirectory: string; projectRootPath: string; @@ -31,7 +31,7 @@ type WorkspaceSetupDaemonClient = { }>; fetchWorkspaces(): Promise<{ entries: Array<{ - id: number; + id: string; name: string; workspaceDirectory: string; projectRootPath: string; @@ -302,18 +302,13 @@ export async function fetchWorkspaceById( client: WorkspaceSetupDaemonClient, workspaceId: string, ): Promise<{ - id: number; + id: string; name: string; workspaceDirectory: string; projectRootPath: string; }> { - const parsedWorkspaceId = Number(workspaceId); - if (!Number.isInteger(parsedWorkspaceId)) { - throw new Error(`Workspace id is not numeric: ${workspaceId}`); - } - const payload = await client.fetchWorkspaces(); - const workspace = payload.entries.find((entry) => entry.id === parsedWorkspaceId) ?? null; + const workspace = payload.entries.find((entry) => String(entry.id) === workspaceId) ?? null; if (!workspace) { throw new Error(`Workspace not found: ${workspaceId}`); }