movex
movex copied to clipboard
[libs/movex] Dispatching multiple actions at the same time causes Promise.Delegate error
What
Dispatching multiple actions at the same time, or before a prev one didn't get a chance to return from the network trip, it causes a Promise.Delegate already settled error. This is expected as buffering isn't built in yet.
This behavior more or less can also be fixed from the reducer, but sometimes we might not want that, so this needs to be fixed.
Solution Ideas
- Detecting multiple actions dispatches at the same time and batch them for the net trip
- When a new action is received on the server, first check if there is a prev action dispatch still being processed before attempting to process it
They both can be implemented actually because 2 is really important no matter what and 1 is an optimization