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
At the moment Fluxor detects self-inflicted endless loop and breaks out of the cycle. This loop started to happen once Effects were executed within a task (so that exceptions could be caught without holding up the pipeline).
In previous versions the routing middleware was able to check the browser's current URL against state and only dispatch an action if it is different, and this was sufficient because although effects can be async, the routing middleware's effect didn't await so executed synchronously.
Now that effects are all run inside an awaited task, this cannot happen synchronously, so by the time the middle checks the state against the current URL the URL could have changed due to an auth redirect to a sign-in page. At which point the middleware updates the browser URL, taking us back to the app, at which point the auth redirects us back to the sign-in page, ad ininitum.
Solution
Change the effects dispatcher so it executes each task outside of the Task.Run (capturing any exceptions to a list), and then only run the Task.WhenAll inside the Task.Run. This will give synchronous effects the opportunity to run and complete immediately.
The text was updated successfully, but these errors were encountered:
Problem
At the moment Fluxor detects self-inflicted endless loop and breaks out of the cycle. This loop started to happen once Effects were executed within a task (so that exceptions could be caught without holding up the pipeline).
In previous versions the routing middleware was able to check the browser's current URL against state and only dispatch an action if it is different, and this was sufficient because although effects can be async, the routing middleware's effect didn't await so executed synchronously.
Now that effects are all run inside an awaited task, this cannot happen synchronously, so by the time the middle checks the state against the current URL the URL could have changed due to an auth redirect to a sign-in page. At which point the middleware updates the browser URL, taking us back to the app, at which point the auth redirects us back to the sign-in page, ad ininitum.
Solution
Change the effects dispatcher so it executes each task outside of the
Task.Run
(capturing any exceptions to a list), and then only run theTask.WhenAll
inside theTask.Run
. This will give synchronous effects the opportunity to run and complete immediately.The text was updated successfully, but these errors were encountered: