Open Ronsku opened 6 years ago
Hi Ronsku,
thanks for you effort and the detailed code & issue descriptions! I looked at your code, and yes its a bug in reactive-state. More precisely, it is a bug in the devtools. If you uncomment the enableDevTools()
line, your code should work as you intended, i guess.
The problem arises from the two-way sync I do between redux and reactive-state in order to get the jump/skip feature working. For now, I have disabled two way sync until I find the issue here. I have released and published version 1.0.1
. You can use the devtools with that version (but no jump/skip), please let me know if that fixes your issue. Feel free to hit me up with any other issues you encounter, as your feedback is highly appreciated.
Sweet! Thank you so much for your fast response and super quick resolve of the issue and even patched it, amazing! It was so confusing, but it all makes sense now. I was just looking in the wrong place.. 🙂
Everything works exactly as expected now and I will close the issue. Thank you once again!
Reopening this as the issue isn't really resolved. I just released a fixed version as I think correctness of code is more important than features in the devtools. But this came at the price of the skip/jump feature in redux devtools.
Hi,
Hope everything is good with you and thank you again for keeping updating reactive-state!
I wanted to check with you for a possible bug with reactive-state. I created the most simple demo project I could for you to demonstrate the issue.
https://github.com/Ronsku/reactive-state-issue
The project handles a "start/stop" and switched between states "Idle/inProgress/completed". That's it!
The weird behaviour happens when the store get's messed up by the values for some reason. What I'm expecting is following result:
What I get is:
And in the redux dev tools you can see that some weird stuff happens.
Stop
action changes theState
value. Stop should not even be running there first of all, but it somehow keeps the old value in the states
-variable and that's why it updates it to an old state, but why?To ge the expected result I can change the actions for
setState
andstart
and destroy the immutable system, like in the following code. These changes should be made inreducer.ts
.Even though you do these changes you still have something weird going on in your store, since in redux dev tools you have following results, even though you end on
idle
-state like you should.I really hope it's my coding mistake, but I cannot really figure out why reactive-state is acting so weird here. I've never had any issues with it before but in this case it seems almost impossible to resolve and it's such straight forward thing that it does. I would be really grateful if you could take a look at the code and the issues and maybe it could even bring out an issue in reactive-state?
If you want/need more information and want to talk to me directly, please send me an email and I will get you a Discord, Skype or any direct messaging invite.
Thank you Timo so much in advance, I really appreciate your help!