Skip to content

Commit 594471e

Browse files
committed
fix: propagate normalizedCwd from search-index errors in projectEntriesFailureContext
The three WorkspaceSearchIndex error branches (CreateFailed, ScanTimedOut, SearchFailed) were not mapping their `cwd` property to `normalizedCwd` in the RPC error context, unlike the workspace-root error branches which correctly mapped `normalizedWorkspaceRoot` to `normalizedCwd`. This prevented clients and telemetry from correlating failures with the resolved workspace path.
1 parent 13e6969 commit 594471e

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

apps/server/src/ws.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,23 @@ function projectEntriesFailureContext(error: WorkspaceEntries.WorkspaceEntriesEr
155155
normalizedCwd: error.normalizedWorkspaceRoot,
156156
};
157157
case "WorkspaceSearchIndexCreateFailed":
158-
return { failure: "search_index_create_failed", detail: error.reason };
158+
return {
159+
failure: "search_index_create_failed",
160+
normalizedCwd: error.cwd,
161+
detail: error.reason,
162+
};
159163
case "WorkspaceSearchIndexScanTimedOut":
160-
return { failure: "search_index_scan_timed_out", timeout: error.timeout };
164+
return {
165+
failure: "search_index_scan_timed_out",
166+
normalizedCwd: error.cwd,
167+
timeout: error.timeout,
168+
};
161169
case "WorkspaceSearchIndexSearchFailed":
162-
return { failure: "search_index_search_failed", detail: error.reason };
170+
return {
171+
failure: "search_index_search_failed",
172+
normalizedCwd: error.cwd,
173+
detail: error.reason,
174+
};
163175
default:
164176
return unexpectedCompatibilityError(error);
165177
}

0 commit comments

Comments
 (0)