Repository navigation
unplugin webpack: never strand a Session when a compile ends without done or failed - #397
Merged
Merged
Conversation
…done or failed
Teardown audit gap A (released in v0.1.25). unplugin closed its Session
only on done or failed, and webpack fires neither when an edit
invalidates a running compile (Watching._done restarts it) or when a
watch closes mid-compile (only watchClose). The stranded Session stayed
joined with its claim, so every later compile threw ("… started an
analysis of build …, which … publishes"). Under webpack and rspack, a run
now retires a Session the previous compile left open before it claims the
build; a watchClose retires the build too. The Rollup family keeps its
Session across buildStart, since it can start environments in parallel.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A fake webpack compiler wires the plugin; its buildStart is webpack's make. 'an edit that restarts the compile never strands its Session' (two makes with no done) and 'a watch closed mid-compile retires its build' (watchClose leaves no session directory). Both red on main a5d1f49. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Teardown audit gap A (ticket 12, coordinated teardown). Released: v0.1.25 (0f29eec) already closed unplugin's webpack Session only on
done.The bug
unplugin's webpack/rspack path closes its Session (and its claim) only on
doneorfailed. webpack fires neither when:Watching._doneseesthis.invalidand restarts with_go()(webpack Watching.js:285-300, 436);_donebecomes the final callback, which fires onlywatchClose(:480-487, :520-525).The stranded Session stays joined with its claim. On the edit path the next
makebuilds a new Session for the same build and throws on every later compile:[animus] "animus-unplugin:…" started an analysis of build …, which "animus-unplugin:…" publishes. On the watchClose path the build, its claim and its session directory stay until the process exits.Fix
buildStart, since Vite and Rollup can start environments in parallel.watchCloseretires the build asdoneandfaileddo.Witnesses
unplugin/tests/failed-load-watch.test.ts› a webpack compile that ends without done or failed, with a fake webpack compiler (the plugin'sbuildStartis webpack'smake):done; red on main a5d1f49 with the claim error above.watchClose, no session directory remains; red on main.Not in this PR
Under unplugin's Vite adapter,
buildEndper environment closes the one active Session; with environments built in parallel (the #395 case for vite-plugin) that may close it under a running environment. Not probed yet; a follow-up for ticket 12.Checks
macOS: unplugin 34/34, lint and fmt clean. Linux CI at efde7d2: run 38175229684, every job green.
🤖 Generated with Claude Code