🤖 bug: same-backend rename/remove can race an in-flight native terminal or editor open
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- desktop
Research direction
Start by tracing TerminalService.openNativeAdmitted and WorkspaceService.recordExternalEditorOpenAdmitted, then read workspaceUseLeases.ts and the existing pendingNativeTerminalOpens/pendingExternalEditorRecordings handling. Verify how same-backend rename and removal are gated, and run the relevant existing tests if found. Done means mutation cannot race either launcher and the counts remain until the launcher returns.
Written by the indexing model from the issue text.
Description
Problem
Follow-up from the review of #4907 (#4902). This backend's own rename and removal ignore its own terminal and editor use leases (by design: they tolerate or end this backend's terminals). So nothing on the same backend makes them wait for a native-terminal or external-editor open that is already past its gate probe:
TerminalService.openNativeAdmitted: after the last gate probe, the open still awaits the durable marker write and the launcher. A rename or removal started in that window can move or delete the checkout, and the terminal launches at the oldnamedWorkspacePath.WorkspaceService.recordExternalEditorOpenAdmitted: after the lease, the marker write and the client round-trip are still in flight, and the launcher uses the path the client already has.
Other backends are not affected: their mutation gate refuses while this backend holds the lease (Dekker ordering in workspaceUseLeases.ts). There is no data loss; the terminal or editor opens at a path that no longer exists. This window existed before #4900 and #4907; those PRs only moved the probe.
Possible fix
Make same-backend rename and removal refuse (or wait) while pendingNativeTerminalOpens / pendingExternalEditorRecordings count an in-flight open for the workspace, as model-facing archive already does, and keep the count until the launcher returns.
Refs #4902, #4907
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 139
- Avg merge
- 6h 58m
- Merged PRs (30d)
- 774
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/xum
-
🤖 tests: localStorage budget worst-case test runs near the 5 s timeout and flakes in the merge queueOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
backlog
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
backlog
Difficulty 5/5 Over a week Newbie friendliness 38/100
Maintainers usually reply within 1 day
Similar issues
-
refactor
Difficulty 2/5 Half a day Newbie friendliness 84/100
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OHDSI/Data2Evidence#3450 ·
Maintainers usually reply within 2 days
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
redhat-developer/rhdh-plugin-export-overlays#4011 · 1 comment ·
Maintainers usually reply within 1 day
-
automation missing-model model-sync provider:ofox
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/models.dev#8421 ·
Maintainers usually reply within 1 day
-
SlackAdapter and TelegramAdapter are not assignable to Adapter under exactOptionalPropertyTypesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day