Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Bug in Middleware History Replay for DevTools for POP Action #164

Closed
mjrussell opened this issue Jan 5, 2016 · 1 comment
Closed

Bug in Middleware History Replay for DevTools for POP Action #164

mjrussell opened this issue Jan 5, 2016 · 1 comment

Comments

@mjrussell
Copy link

Was playing with the current master version because it looked pretty cool and I noticed an issue with the redux devtool time time traveling. I spoke to @taion on Discord about it but wanted to make an issue because Im curious about how it can be ultimately solved and can track it easier this way.

Currently the syncHistoryToStore will update the location object if you reset actions via the redux-devtools. This works really well and is really awesome but has an issue when the the last action to be applied is a POP. The POP happens typically because the user navigated with the URL bar or opened the page for the first time. The POP can't be applied correctly though so the URL bar is not correctly updated even though the reducer data.

This results in the URL being different from what is actually rendering and is pretty confusing.

One thought I had is to dispatch an action instead of calling the history API in this case, resulting in a another action being added to devTools, "showing" the user that you can't replay that far back. This dispatch could also be a REPLACE instead of a POP which would ensure the URL will match the reducer state. Im eager to hear/see other solutions though.

@jlongster
Copy link
Member

Getting devtools to work is pretty complicated, and I think we've decided to veer towards not guaranteeing the URL will be in sync rather than messing with the action history. If you are time traveling, there are going to be things we can't do with the URL in the location field, and I think that's ok.

I'm going to release 2.0.0 today or tomorrow, so we should get more people using and we'll see how it goes. Maybe there's another fix for it, but we definitely don't want to fire more actions as you time travel.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants