Skip to content

Commit 341b669

Browse files
authored
fix: allow multiple navigations to happen in LifecycleWatcher (#8826)
There is no repro but it looks like sometimes the backend reports two navigation requests. This PR changes the logic to allow that instead of failing as it seems that failing is a bigger issue than handling multiple navigation requests. Closes #8811
1 parent b9b24cf commit 341b669

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/common/LifecycleWatcher.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,10 @@ export class LifecycleWatcher {
179179
return;
180180
}
181181
this.#navigationRequest = request;
182-
this.#navigationResponseReceived?.reject(
183-
new Error('New navigation request was received')
184-
);
182+
// Resolve previous navigation response in case there are multiple
183+
// navigation requests reported by the backend. This generally should not
184+
// happen by it looks like it's possible.
185+
this.#navigationResponseReceived?.resolve();
185186
this.#navigationResponseReceived = createDeferredPromise();
186187
if (request.response() !== null) {
187188
this.#navigationResponseReceived?.resolve();

0 commit comments

Comments
 (0)