-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old reducers still re-run #993
Comments
@Siyfion can you test if this is fixed now? |
@helfer Just tested with |
@Siyfion okay, in that case I will need a bit more information, ideally a minimal reproduction or a failing test case. |
@helfer I don't really know how best to provide a reproduction, but a simple component like: https://gist.github.com/Siyfion/fa29549a77111f017efd9413ff32c04b And a simple toggle switch that removes / adds the component with each click is enough to demonstrate the issue. For each additional |
I can confirm I'm running into the same issue. I have a list of posts on my homepage, and inserting posts into it works fine. But if I go to another page (which unmounts the post list), come back, and try inserting again, I get a If you want to test it out you can pull the latest version of Nova: https://github.com/TelescopeJS/Telescope/tree/apollo |
Should be fixed in 0.5.22. |
Awesome, thanks so much! |
I think this might be related to #960 or potentially #930 but it's not the same as either.
I believe that the issue is caused by "old" reducers still being re-run even though they are marked as old, causing a "double" (or more) firing of the event.
Symptoms:
I have a component that is created when the user navigates to a particular route, if I delete an item on that page the
reducer
fires once and updates the query's previous result and removed the deleted item from the results set.If I leave that route (unmounting the component) and re-enter it again, upon deletion the
reducer
will fire twice, attempting to remove the result twice. As I hadn't originally foreseen the item never being there, the_.findIndex
call returned -1 on the second trigger then removed a second item (one that actually hadn't been deleted!).I've mentioned this to @helfer and he suggested making an issue here..
The text was updated successfully, but these errors were encountered: