Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049887Openbravo ERPA. Platformpublic2022-07-27 12:432022-07-27 12:44
marvintm 
Triage Platform Base 
normalmajorrandom
newopen 
5
 
 
Core
No
0049887: It should not be possible to execute more than one state action concurrently
The State API introduced in 20Q4 as part of the IndexedDB project currently allows to execute multiple state actions concurrently.

This can happen because the first stage of the action execution (the ActionPreparation phase) may be asynchronous, and in this case, the event loop will then allow other functions to be called, and they could then launch a different action.

The infrastructure is currently not restricting this, and it may lead to inconsistent behavior, as both actions will be executed, generating separate final states, and only the one that finishes later will prevail, "reverting" the state generated by the other action.
- Execute two calls to an action that includes an asynchronous action preparation.
- Notice that both of them are called. This is wrong.
There are two things that must be checked:

- First, although it is currently not possible to call an action from inside another action function, it seems it may be possible to do this from an ActionPreparation. If this is possible, it should be restricted.

- Then, it should also not be possible to execute an action from any component while another action is being executed. The infrastructure should also be able to detect this, and restrict it.


In both cases, we propose the execution to fail, like it currently does when trying to call an action from inside the action. However, once we go through the integration, depending on the results, we may need to discuss again to think what is the best course of action.
No tags attached.
Issue History
2022-07-27 12:43marvintmNew Issue
2022-07-27 12:43marvintmAssigned To => Triage Platform Base
2022-07-27 12:43marvintmModules => Core
2022-07-27 12:43marvintmTriggers an Emergency Pack => No
2022-07-27 12:44marvintmProposed Solution updated

There are no notes attached to this issue.