ngrx / store-devtools

Developer Tools for @ngrx/store
MIT License
325 stars 38 forks source link

Action type: '@ngrx/store/update-reducers' #78

Open chekit opened 6 years ago

chekit commented 6 years ago

I'm faced with strange behaviour by @ngrx/store-devtools.

Environment:

Problem

If I'm using this packages with corresponding versions:

    "@ngrx/effects": "^4.1.1",
    "@ngrx/store": "^4.1.1",
    "@ngrx/store-devtools": "^5.0.0",

When I'm opening Redux Devtools in Chrome among my Actions stack there is one with type @ngrx/store/update-reducers. That action causes the app to fail, cause the last action in stack has state as undefined. If I click 'skip' on that action (@ngrx/store/update-reducers) the app starts working normally and every action will have its proper state.

If I'm changing version to 4.0.0. everything works properly without any side actions.

    "@ngrx/effects": "^4.1.1",
    "@ngrx/store": "^4.1.1",
    "@ngrx/store-devtools": "4.0.0",
drew-codes commented 6 years ago

Encountering this exact issue, however I am using "@ngrx/store": "5.0.0"

Halt001 commented 6 years ago

Could it be that one of your reducers is not returning the unmodified state for unknown actions in the default clause of an action switch?

chekit commented 6 years ago

@Halt001 For my case I have added a default clause for all reducers and got the issue with @ngrx/store/update-reducers If you interested you can check the demo app where I fist faced with that issue: https://github.com/chekit/ngrx-101/tree/final/src/app/store/reducers (branch final)

Halt001 commented 6 years ago

I see what you mean. You don't have to skip @ngrx/store/update-reducers to make it work again. If you toggle skip on the last action in the stack the state is no longer undefined and it also starts working again.

Another observation is that when viewing the last action on the stack the state is undefined but the diff says states are equal, which isn't true. Also the last action in the stack is displayed in a slightly dimmed grey so it looks like some processing hasn't finished yet.