File tree Expand file tree Collapse file tree
packages/opencode/src/altimate/workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,6 +411,9 @@ export async function unlink(directory: string): Promise<UnlinkReport> {
411411 // a blocking git call — is reached only for a project with no local row, which
412412 // is the case unlink exists to repair.
413413 let identifier : ProjectIdentifier
414+ // The workspace being unlinked, for telemetry: the local row's id, else the one the
415+ // server lookup below finds (the no-local-row recovery path).
416+ let unlinkingId : number | undefined = was ?. datamateId
414417 if ( was ?. repoRemote ) identifier = { repoRemote : was . repoRemote }
415418 else if ( was ?. projectPath ) identifier = { projectPath : was . projectPath }
416419 else {
@@ -431,8 +434,9 @@ export async function unlink(directory: string): Promise<UnlinkReport> {
431434 if ( hit ?. matchedBy === "path" && detected . projectPath ) {
432435 identifier = { projectPath : detected . projectPath }
433436 }
437+ unlinkingId ??= hit ?. binding ?. datamate_id
434438 }
435- const removedServerSide = await WorkspaceApi . unbindProject ( identifier , was ?. datamateId )
439+ const removedServerSide = await WorkspaceApi . unbindProject ( identifier , unlinkingId )
436440
437441 // Only the row unlink started from. A relink that completed while the DELETE
438442 // was in flight recorded a new row, and removing that — then memoizing the
You can’t perform that action at this time.
0 commit comments