movex icon indicating copy to clipboard operation
movex copied to clipboard

[libs/movex] Dispatching multiple actions at the same time causes Promise.Delegate error

Open GabrielCTroia opened this issue 1 year ago • 0 comments

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. Screenshot 2024-01-10 at 6 19 05 PM Screenshot 2024-01-10 at 6 19 25 PM

Solution Ideas

  1. Detecting multiple actions dispatches at the same time and batch them for the net trip
  2. 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

GabrielCTroia avatar Jan 11 '24 00:01 GabrielCTroia