-
Notifications
You must be signed in to change notification settings - Fork 397
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
commit is fired multiple times if other actions are dispatched during request #23
Comments
@jevakallio any ideas on this? This is making me a lot of trouble and I don't know how to get around this issue. Every time I dispatch some UI specific actions immediately after dispatching an action with an offline key, the reconciler is fired multiple times therefore creating duplicated entities in my backend. Any idea how to solve it which points me into the right direction would be great and I'll submit another PR. |
I have the same problem. When my app starts dispatch an action that does not have meta and another that has meta, and the action with meta is dispatched twice. In my case, "persist/REHYDRATE" action causes that the action with meta be dispatched twice. |
I am still having this problem. I am using redux thunk.
It seems if I dispatch a |
Extract send from middleware
Seem to be having a similar issue, using version 2.6.0 |
This is strange it shouldve been fixed a while back, could you share more info? Maybe a reproduction of the bug or a screenshot of the devtools logs. |
Following scenario (react-native, should apply to web, too):
During component mounting, I dispatch an action to be picked up by
redux-offline
. During the time the request is made, I dispatch some other actions, which should not be handled byredux-offline
. However, these actions will be picked up by the middleware and will end in calling thecommit
handler multiple times for the amount of times of the actions, which have been dispatched during the time the request is made (or during the time the effect waits for promise resolve).I hope you understand what I mean, it's not that simple to describe. My proposed solution to this would be to check in the middleware if an meta.offline key is present, otherwise just ignore the action.
What do you think?
The text was updated successfully, but these errors were encountered: