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
fix: replace series function used to queue async callbacks (#11485)
**Motivation**
This function is used to ensure that all state change callbacks to sync
the local browser history state run in series. The functions are async
because `history.go` is not a synchronous function.
I noticed that in chrome, the URL was updating to the previous url
instead of the new one in some navigations and tracked it down to the
fact that the `history.go` navigation takes longer than in other
browsers. This function is supposed to mitigate that, but I believe it
has a bug. The function will not properly return early, because the
finally clause will still always run and immediately reset the
`isRunning` state. Even after fixing this, the function didn't quite
work right for queuing more than two callbacks.
I have replaced the function with a simpler implementation that does the
same task.
**Test plan**
Describe the **steps to test this change** so that a reviewer can verify
it. Provide screenshots or videos if the change affects UI.
The change must pass lint, typescript and tests.
---------
Co-authored-by: Michał Osadnik <[email protected]>
0 commit comments