ngrx / platform

Reactive State for Angular
https://ngrx.io
Other
8.05k stars 1.98k forks source link

Bug(RouterStore): Actions stop firing #960

Closed dummdidumm closed 6 years ago

dummdidumm commented 6 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?

When a router state change not initiated by router.navigate(), i.e. initiated by an action leads to a route change, the StoreRouterModule gets into a buggy state where the "route change triggered by dispatch"-boolean is never reset, and ROUTER_NAVIGATION-events are no longer fired which leads to the store not updating the router state anymore. This is especially hurtful when a state is imported and the last action is not a router action, but the route is different.

Expected behavior:

RouterStoreModule should continue to fire actions.

Minimal reproduction of the problem with instructions:

  1. Open example app with devtools open
  2. Login -> you should be on "my collection" page now
  3. Export state
  4. Navigate to "find books" page
  5. Import state -> you should be back on "my collection" page now
  6. Navigate to "find books" page -> notice that ROUTER_NAVIGATION action is no longer fired.

Version of affected browser(s),operating system(s), npm, node and ngrx:

Independent of browser/npm/node, ngrx 5.2.0

brandonroberts commented 6 years ago

You already had a fix for this right? Will you submit that as a PR?