Skip to content

fix(core): make workspace destroy idempotent - #44769

Merged
kitlangton merged 2 commits into
v2from
feat/workspace-destroy-idempotent
Aug 24, 2026
Merged

fix(core): make workspace destroy idempotent#44769
kitlangton merged 2 commits into
v2from
feat/workspace-destroy-idempotent

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Make workspace.destroy postcondition-idempotent and report { destroyed: boolean }: true when this call removed an existing workspace, false when it was already absent.

Durable callers retry the same workspace ID after failures and crashes. If teardown succeeded but its acknowledgement was lost, the old Workspace.NotFound response wedged that retry loop and forced every caller to special-case absence.

How

  • Treat an absent workspace as an already-satisfied destroy postcondition without invoking its provider driver.
  • Keep Workspace.NotFound for operations where absence breaks the request, including connect and provision.
  • Add and document the V2 workspace.destroy endpoint, thread the result through the server and SDK, and regenerate Promise and Effect clients.
  • Cover existing, repeated, never-created, SDK, generated-client, and HTTP destroy behavior.

Testing

  • bun run test in packages/core (2239 passed, 16 skipped)
  • bun run test in packages/server (27 passed)
  • bun run test in packages/sdk (23 passed)
  • bun test test/promise.test.ts --test-name-pattern 'workspace.destroy returns the transition result' in packages/client
  • bun typecheck in packages/core, packages/protocol, packages/server, packages/client, and packages/sdk
  • Push hook: repository-wide bun turbo typecheck --concurrency=3 (32 packages passed)

@kitlangton
kitlangton merged commit a02b0a4 into v2 Aug 24, 2026
5 of 11 checks passed
@kitlangton
kitlangton deleted the feat/workspace-destroy-idempotent branch August 24, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant