You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: close hot transport on plugin shutdown - #5781
When webpack-dev-server runs as a webpack plugin, compiler.close() can stop the HTTP server while leaving a separately listening built-in WebSocket endpoint accepting connections and sending heartbeats.
Close middleware-owned built-in hot transports during plugin shutdown while leaving compiler watching to its host.
Changes
Close built-in hot coordinators without invoking ordinary middleware shutdown or duplicating custom transport cleanup.
Add regression coverage for listener release, existing client closure, heartbeat termination, natural process exit, and watcher ownership.
Cover SSE and disabled-hot overrides, custom transport ownership, and helper failure paths.
The four regression/ownership cases passed again before committing.
Targeted ESLint and Prettier checks passed.
TypeScript, changeset validation, and Git diff checks passed.
The shutdown regression failed before the production correction and passed afterward.
Limitations
The full repository suite and browser-dependent tests were not run locally. Hosted CI has not run against this contribution.
Summary by CodeRabbit
Bug Fixes
Built-in WebSocket and server-sent event connections now close when a plugin-managed compiler shuts down, including WebSocket endpoints listening separately.
Host-owned compiler watching remains active when a plugin-managed compiler shuts down.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a30beb18-5c86-47d5-9bac-99620715ef02
Commits
Reviewing files that changed from the base of the PR and between d78f183 and a160fe1.
Files selected for processing: 4
.changeset/quiet-hot-shutdown.md
lib/Server.js
test/e2e/api-plugin.test.js
test/helpers/plugin-transport-shutdown.js
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Walkthrough
Plugin-mode shutdown now closes and clears the middleware-owned built-in WebSocket or SSE transport. The added test helper observes HTTP and WebSocket behavior before and after shutdown. End-to-end tests cover shutdown outcomes, cleanup failures, and transport ownership.
Priority: Normal
Merge Risk: Low · up to a160f
An immediate restart may briefly find the hot WebSocket port occupied. This is a bounded risk that does not otherwise prevent merging.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix: close hot transport on plugin shutdown" matches the main change. The PR closes the middleware-owned built-in hot transport (WebSocket or SSE) when a plugin compiler shuts down, and the…
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix: close hot transport on plugin shutdown" matches the main change. The PR closes the middleware-owned built-in hot transport (WebSocket or SSE) when a plugin compiler shuts down, and the changeset, lib/Server.js change, and tests all cover this. The title is short, uses a conventional prefix, and names the primary behavior. It does not describe the preserved compiler watching or the test helper, which is expected for a title.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 unsupported.)
Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
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
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.
Summary
When webpack-dev-server runs as a webpack plugin,
compiler.close()can stop the HTTP server while leaving a separately listening built-in WebSocket endpoint accepting connections and sending heartbeats.Close middleware-owned built-in hot transports during plugin shutdown while leaving compiler watching to its host.
Changes
Testing
Limitations
The full repository suite and browser-dependent tests were not run locally. Hosted CI has not run against this contribution.
Summary by CodeRabbit