Translate duplicate environment path finalization into a stable error - #3234
Open
bb-slop-cop[bot] wants to merge 1 commit into
Open
Translate duplicate environment path finalization into a stable error#3234bb-slop-cop[bot] wants to merge 1 commit into
bb-slop-cop[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Concurrent unmanaged workspace starts can create distinct environment rows whose paths remain null until host provisioning completes. When both successful results later resolve to the same project, host, and path tuple, the second metadata update crosses the database uniqueness index. The settlement exception was then persisted verbatim as the thread provisioning failure detail. The verified investigation is in the reproduction and root-cause report.
What changed
Environment provisioning settlement now recognizes only the named project/host/path uniqueness conflict and translates it into a stable server-domain error. The existing failure path still marks the losing environment and thread as failed; no lifecycle ownership, database schema, wire protocol, CLI, or public API changes were made.
The regression test creates two pathless unmanaged environments, settles both host commands to one path, and verifies that the losing thread receives the stable detail rather than database implementation text.
How you verified
pnpm exec turbo run test --filter=@bb/server -- test/environments/environment-provisioning.test.tspassed all 12 tests.pnpm exec turbo run typecheck --filter=@bb/serverpassed.EISDIRbut receivedENOTSUP; the same failure reproduces on the clean base checkout.git diff --checkpassed.origin/main: 131 total text lines (117 additions, 14 deletions) across two files.Fixes #3233