Repository navigation
fix: await rejectChange() in rejectAll() to avoid overlapping cleanup - #728
Merged
will-lamerton merged 2 commits intoAug 2, 2026
Merged
Conversation
jmdlrg
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
July 31, 2026 18:04
Member
|
Thanks for this PR @jmdlrg - feel free to add yourself as a contributor to our website via a PR which I will approve :) https://nanocollective.org/contributors |
Contributor
Author
Thanks! Just opened the contributor PR: Nano-Collective/organisation#86 |
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.
Description
rejectAll()in the VS Code extension's diff manager fired the asyncrejectChange()without awaiting, so rejecting several pending diffs at once ran their cleanups concurrently. This makesrejectAll()await each rejection sequentially, mirroring howapplyAll()already awaitsapplyChange().On the issue's verification note (whether concurrency was intentional): three signals say it wasn't — (1)
applyAll(), the sibling method, already awaits sequentially; (2) concurrency buys nothing here since extension-host UI operations serialize anyway; (3)closeEditors()snapshotsvscode.window.tabGroups.alland closes tabs against that snapshot, so concurrent rejections hold staleTabreferences and race over shared editor state — the exact hazard the issue describes.Signature change (
void→Promise<void>): safe — neitherrejectAll()norapplyAll()currently has callers in the repo.Possible follow-up (out of scope here):
rejectChange()has notry/catch(unlikeapplyChange()), so a failure now aborts the remaining rejections instead of becoming a silent unhandled rejection. Happy to address that in a separate PR if you wantrejectAll()to keep going on per-change failures.Fixes #725
Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfiles — N/A (bug fix; the VS Code plugin has no test infrastructure)pnpm test:allcompletes successfully) — format, type and lint checks pass; 8 test failures incli-integrationandsettings-tabsreproduce identically on a cleanmaincheckout on my machine, so they're pre-existing and unrelatedVerified the change with
pnpm run build:ext(clean) andtsc --noEmiton the plugin (clean).Manual Testing
N/A — the fix is in the VS Code extension's diff manager and is provider-agnostic.
Checklist