-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ngrx/router-store triggers unexpected ROUTER_CANCEL action if store is modified by guard . #446
Comments
Can you make a small repro? |
Sample added. |
This issue has already been fixed in master and will be in the next release. #355 |
When will it be released? Thanks. |
I keep getting this error even with new master. |
this issue is still not resolved |
I'm refactoring an app from excessive resolver-use to NgRx and get unexpected navigation cancelled events, as well, even though the resolvers themselves don't even inject the store. Since I'll make all resolvers non-blocking and use them as a hook to dispatch actions more or less declaratively via the route config, it won't be an issue for me, but there's definitely still something wrong. |
I'm submitting a...
What is the current behavior?
If the store is asynchronously modified by route guard, during the transition StoreRouterConnectingModule is executing navigateByUrl on router, because the url set in state by StoreRouterConnectingModule (taken from NavigationStart event) is different than router.url value (which contains url from before of transition). This cause cancellation of previous navigation, and next try to execute the navigation (for same url), and again and again, until the guard will not return true synchronously.
Please look at code https://github.com/ngrx/platform/blob/master/modules/router-store/src/router_store_module.ts#L209
Expected behavior:
StoreRouterConnectingModule should not trigger navigateByUrl if state is modified by guard.
Minimal reproduction of the problem with instructions:
Please look at: http://plnkr.co/edit/SbecXWSzFMnSRA9JFQ0i
Version of affected browser(s),operating system(s), npm, node and ngrx:
latest
Other information:
The text was updated successfully, but these errors were encountered: