Store: 馃悶[BUG]: Route not updated via ReduxDevTools

Created on 3 Jul 2020  路  6Comments  路  Source: ngxs/store

Affected Package

NgxsRouterPluginModule and/or NgxsReduxDevtoolsPluginModule?

Is this a regression?

I believe so

Description

I have a default Angular CLI v9 app. Have added NGXS with router and devtools plugin according to the docs. When I navigate between routes, router state is updated as expected and I can see this in ReduxDevtools extension for Chrome. However, when I try to step back to previous route via devtools, the app route does not update.

Expected behavior is "time-travel debugging" where the application updates to the route contained in the store, correct?

馃敩 Minimal Reproduction

https://stackblitz.com/edit/ngxs-router-bug

Environment


Libs:

  • @angular/core version: ~9.1.11
  • @ngxs/store version: ^3.6.2

    Using Angular v9 because NGXS support for v10 isn't final.

Browser:

  • [x] Chrome (desktop) version LATEST
  • [ ] Chrome (Android) version XX
  • [ ] Chrome (iOS) version XX
  • [ ] Firefox version XX
  • [ ] Safari (desktop) version XX
  • [ ] Safari (iOS) version XX
  • [ ] IE version XX
  • [ ] Edge version XX

For Tooling issues:

  • Node version: 14.3.0
  • Platform: Mac

Most helpful comment

I have the same issue.

All 6 comments

I have the same issue.

Doing some further investigation today.

When stepping backwards via ReduxDevTools, router plugin's navigateIfNeeded method returns false.
https://github.com/ngxs/store/blob/86c7f70aee008b1d487c3b59d7e788c4cbff3621/packages/router-plugin/src/router.state.ts#L157-L167

This is due to !this._storeState evaluating to true.

Will continue to look into this...

UPDATE
trigger is set to 'none'.
https://github.com/ngxs/store/blob/86c7f70aee008b1d487c3b59d7e788c4cbff3621/packages/router-plugin/src/router.state.ts#L138-L144
This skips setting _storeState which in turns causes navigateIfNeeded to return false.

Would be happy to contribute a PR for this but need a little guidance on what the intent is here and how to proceed without breaking something else. @splincode?

@arturovt what do you think?

@bmayen I will be happy if you create PR for fixing this bug (maybe we can use special option for migrate new your behavior for prevention breaking change)

I'll need some additional help in order to get this PR to you.

My first guess on a fix here is that it seems like we need a different set of conditions for canSkipNavigation if triggered from ReduxDevTools. Is there a way to detect this?

Is this a sensible line of thinking for this problem?

Any updates on this issue? This is almost a blocker for most people because it makes redux dev tools and time travel useless. 馃

Agreed this is a blocker in many cases. Unfortunately, I didn't get much further on a solution without additional feedback, and my bandwidth is pretty limited these days. Maybe someone else could pick this up?

Was this page helpful?
0 / 5 - 0 ratings