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
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
What is the current behavior?
The navigation is cancelled when an action dispatched during a guard checking.
A simple timeline:
Navigate to a page which has an async guard
Before the guard is resolved, emit an action
The navigation will be cancelled and relaunched even if the guard accepts the navigation
Expected behavior:
Simple timeline:
Navigate to a page which has an async guard
Before the guard is resolved, emit an action
The navigation should not be cancelled when the guard accepts the navigation
Minimal reproduction of the problem with instructions:
Click on the button, 'GO_TO_PAGE' action is dispatched
AppEffects.goToPage$ initiates a navigation to /page (using navigateByUrl)
AppEffects.whatever$ starts to wait half second
Async AppGuard is activated which starts to wait 1 second
AppEffects.whatever$ has finished waiting, emits any action (without any other side-effect)
AppGuard has finished waiting, returns true
Navigation is cancelled and started again for /page
Async AppGuard is activated again which starts to wait 1 second
AppGuard has finished waiting, returns true
Navigation is finished for /page
The expected behavior is to skip step 6, 7 and 8.
Version of affected browser(s),operating system(s), npm, node and ngrx:
@ngrx/router-store: 4.0.4
Other information:
You can "fix" this on the user side by not registering the routerReducer, or registering it, but with different name.
I have a simple fix for the library too, PR is on the way.
The text was updated successfully, but these errors were encountered:
kondi
added a commit
to kondi/platform
that referenced
this issue
Sep 6, 2017
I'm submitting a...
What is the current behavior?
The navigation is cancelled when an action dispatched during a guard checking.
A simple timeline:
Expected behavior:
Simple timeline:
Minimal reproduction of the problem with instructions:
(For a simple reproduction see my unit test: https://github.com/kondi/platform/blob/13feb6c12118955473f351e6fc7e3575699d93f3/modules/router-store/spec/integration.spec.ts#L377.)
Detailed plunker example:
https://plnkr.co/edit/VVe26uhP3qoNARyhPmi1?p=preview
After clicking on button, you can see in the console:
However you should see:
Explanation of the attached plunker example:
AppEffects.goToPage$
initiates a navigation to/page
(usingnavigateByUrl
)AppEffects.whatever$
starts to wait half secondAppGuard
is activated which starts to wait 1 secondAppEffects.whatever$
has finished waiting, emits any action (without any other side-effect)AppGuard
has finished waiting, returns true/page
AppGuard
is activated again which starts to wait 1 secondAppGuard
has finished waiting, returns true/page
The expected behavior is to skip step 6, 7 and 8.
Version of affected browser(s),operating system(s), npm, node and ngrx:
@ngrx/router-store: 4.0.4
Other information:
You can "fix" this on the user side by not registering the routerReducer, or registering it, but with different name.
I have a simple fix for the library too, PR is on the way.
The text was updated successfully, but these errors were encountered: