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: await openBrowser before resolving start - #5805
In Server.prototype.openBrowser, browser launch operations across target URLs are handled using open(...). While the method is declared async and awaited by logStatus() (await this.openBrowser(openTarget)), the internal Promise.all(...) call was previously neither returned nor awaited.
Because of this, await server.start() resolved prematurely before external browser launch processes were spawned or any launch rejections were caught. This change adds await Promise.all(...) inside openBrowser(), ensuring server.start() properly awaits browser launch completion.
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes. Added a unit test in test/server/open-option.test.js verifying that server.start() / openBrowser() awaits asynchronous resolution of open() before resolving.
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
A patch changeset has been added in .changeset/await-open-browser.md. No public documentation updates are required.
Use of AI
AI (Antigravity) was used to assist in locating the floating Promise.all in openBrowser, formulating the test case in test/server/open-option.test.js, and running local pre-PR verification checks. All code was locally tested and validated against the full lint and test suites.
Summary by CodeRabbit
Bug Fixes
server.start() now waits for configured browser-opening actions to finish before resolving.
Await the internal Promise.all in Server.prototype.openBrowser so that server.start() does not resolve before browser launch operations complete.
Fixeswebpack#5804
Review was skipped as selected files did not have any reviewable changes.
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: 9b2c7fa3-911b-4cd1-a192-9acee7cfbedf
Commits
Reviewing files that changed from the base of the PR and between c451a85 and fe83a12.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Walkthrough
Server.openBrowser now awaits the promises that open configured browser targets. A test verifies that server.start() resolves only after the mocked browser-opening operation completes. A patch changeset documents this behavior.
Severity of issue fixed: Medium
Merge Risk: Low · previous review c451a
server.start() now waits for browser launch to finish, as the linked issue requests. The remaining note is a small test cleanup improvement and does not affect production behavior.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title fix: await openBrowser before resolving start matches the main change. The PR adds await to the Promise.all call in openBrowser so server.start() waits for browser launch to settle, and adds…
Linked Issues check
Issue #5804 requires openBrowser() to await its internal Promise.all(...) so that await server.start() does not resolve before browser launch completes. The diff between the merge base and head …
Out of Scope Changes check
Whole-PR changes are lib/Server.js (one-line await added in openBrowser), test/server/open-option.test.js (+25 lines, a test that delays mocked open() and asserts completion after `server.st…
Full details: Title check
Explanation
The title fix: await openBrowser before resolving start matches the main change. The PR adds await to the Promise.all call in openBrowser so server.start() waits for browser launch to settle, and adds a test and changeset for this behavior.
Full details: Linked Issues check
Explanation
Issue #5804 requires openBrowser() to await its internal Promise.all(...) so that await server.start() does not resolve before browser launch completes. The diff between the merge base and head in lib/Server.js changes Promise.all( to await Promise.all( inside Server.prototype.openBrowser. This is the proposed fix in the issue. The open(...) calls already attach .catch(...) inside the map, so the awaited promise does not reject on individual launch failures. The logStatus() call site already awaits openBrowser, so the await now propagates through server.start(). The issue has no other coding requirements. The test and changeset are supporting artifacts. The test itself was not independently inspected in this review.
Full details: Out of Scope Changes check
Explanation
Whole-PR changes are lib/Server.js (one-line await added in openBrowser), test/server/open-option.test.js (+25 lines, a test that delays mocked open() and asserts completion after server.start() resolves), and .changeset/await-open-browser.md (patch changeset). The test directly verifies the fixed behavior and the changeset documents a patch fix. All changes connect to issue #5804. No unrelated changes were identified in the inspected diff.
Finishing Touches
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.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
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: c0378c04-49e4-4793-bba9-4f6e45f8f423
Commits
Reviewing files that changed from the base of the PR and between 796262e and c451a85.
Files selected for processing: 3
.changeset/await-open-browser.md
lib/Server.js
test/server/open-option.test.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.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Stop the server when the assertion fails.
If the missing-await regression returns, Line 945 throws before server.stop() runs. The suite's afterEach only clears and restores the mock; it does not close this server. The failed test therefore leaves the listening server and compiler watcher active. (raw.githubusercontent.com)
Put the assertion inside try and call await server.stop() in finally. This preserves cleanup on both passing and failing assertions.
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.
Fixes #5804
Summary
In
Server.prototype.openBrowser, browser launch operations across target URLs are handled usingopen(...). While the method is declaredasyncand awaited bylogStatus()(await this.openBrowser(openTarget)), the internalPromise.all(...)call was previously neither returned nor awaited.Because of this,
await server.start()resolved prematurely before external browser launch processes were spawned or any launch rejections were caught. This change addsawait Promise.all(...)insideopenBrowser(), ensuringserver.start()properly awaits browser launch completion.What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes. Added a unit test in
test/server/open-option.test.jsverifying thatserver.start()/openBrowser()awaits asynchronous resolution ofopen()before resolving.Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
A patch changeset has been added in
.changeset/await-open-browser.md. No public documentation updates are required.Use of AI
AI (Antigravity) was used to assist in locating the floating
Promise.allinopenBrowser, formulating the test case intest/server/open-option.test.js, and running local pre-PR verification checks. All code was locally tested and validated against the full lint and test suites.Summary by CodeRabbit
server.start()now waits for configured browser-opening actions to finish before resolving.