Skip to content

Commit d8bc5c7

Browse files
fix: carry the server-found workspace id through a recovery-path unlink
When no local row exists, manage.ts looks the binding up on the server before unlinking; the id it finds now reaches workspace_unlinked. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_011AhtJPr3nmT1Po92ZQk4VE
1 parent 0ba9043 commit d8bc5c7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/opencode/src/altimate/workspace

‎packages/opencode/src/altimate/workspace/manage.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)