Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@
"@types/[email protected]": "patches/@[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
}
}
}
24 changes: 24 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/lib/client/browserContext.js b/lib/client/browserContext.js
index 0b5cb3356cdc4917d9198a184f1a2cb391924453..3ad3d86bebde7a7e25af4f94b964d003e10d40a0 100644
--- a/lib/client/browserContext.js
+++ b/lib/client/browserContext.js
@@ -183,6 +183,19 @@ class BrowserContext extends import_channelOwner.ChannelOwner {
_onRequestFailed(request, responseEndTiming, failureText, page) {
request._failureText = failureText || null;
request._setResponseEndTiming(responseEndTiming);
+ // PATCH (next.js): mirror what `_onRequestFinished` does for the
+ // response, so callers awaiting `response.finished()` don't hang on
+ // failed/canceled requests. The server side already resolves the
+ // server-side `_finishedPromise` from `_onLoadingFailed` (see
+ // chromium/crNetworkManager.js), but only the `requestFinished` IPC
+ // carries a response payload — `requestFailed` does not, so the
+ // client-side Response's `_finishedPromise` is otherwise never
+ // resolved. We look up the response via the existing async RPC and
+ // resolve it fire-and-forget; catch is a no-op so we never produce
+ // an unhandled rejection if the context tears down concurrently.
+ request.response().then((response) => {
+ if (response !== null) response._finishedPromise.resolve(null);
+ }).catch(() => {});
this.emit(import_events.Events.BrowserContext.RequestFailed, request);
if (page)
page.emit(import_events.Events.Page.RequestFailed, request);
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading