Skip to content

Commit

Permalink
fix: allow multiple navigations to happen in LifecycleWatcher (#8826)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
OrKoN committed Aug 22, 2022
1 parent b9b24cf commit 341b669
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/common/LifecycleWatcher.ts
Expand Up @@ -179,9 +179,10 @@ export class LifecycleWatcher {
return;
}
this.#navigationRequest = request;
this.#navigationResponseReceived?.reject(
new Error('New navigation request was received')
);
// Resolve previous navigation response in case there are multiple
// navigation requests reported by the backend. This generally should not
// happen by it looks like it's possible.
this.#navigationResponseReceived?.resolve();
this.#navigationResponseReceived = createDeferredPromise();
if (request.response() !== null) {
this.#navigationResponseReceived?.resolve();
Expand Down

0 comments on commit 341b669

Please sign in to comment.