ngrx-store-localstorage
ngrx-store-localstorage copied to clipboard
update-reducers fix
fix issue overwriting values with old values from rehydrated state, when reducers are updated.
Not sure if the test is needed, because update action is deleted.
lgtm
I'm not close enough to the project at this point to understand all of the impact this change may have. This will require a major version bump to be safe, no? @ernestomancebo @bufke
😴😴😴
Any news about when/if this PR will be completed?
I'm having a tough time producing the bug. Do you have a sample project that demonstrates it? I attempted to reproduce it by logging in to an app. Reload. Manually dispatching (via redux devtools) a login action that would set a new auth token. Then navigating to a lazy loaded route. I see a update action as you mention. I did not see any old state reappear.
I see a couple people have interest in this bug. I don't feel comfortable merging without understanding the problem fully. I don't know the historical reason for checking the UPDATE_ACTION either.
I did try this patch with some of my apps including some with lazy loading and didn't notice any regressions. The unit test is helpful but it's a very controlled test and I'd like to understand how this bug effects a real project.
I just tested the one-line fix (removing the check for action.type === UPDATE_ACTION), and it fixes the issue in our application. Anxiously awaiting this to be merged in! It actually uncovered a few other bugs in our application that had a strange dependency on the wrongly-rehydrated state!
@BillyBlaze no one owes you their time. If you'd like to pay a contractor to support your open source software you are welcome to do so. If you think you can maintain the project better you are welcome to ask to join or fork it.
I'm hesitant to merge this in as the UPDATE_ACTION was explicity added to fix a few issues back in #76, so if this is merged it's likely to reintroduce those issues.
For those that need this fix, there is a workaround https://github.com/btroncone/ngrx-store-localstorage/issues/120#issuecomment-540567596