The undo/redo event stack currently supports actions consisting of several individual events. However, if one of these events fails, the application can get into an inconsistent state (where some changes were already made, but others were not). We should address this - so far, the following options have come to my mind:
Track the original state before the composite action is started so that we can safely return to it if something fails.
When an event fails, reverse all the already-completed events of the batch one by one (some problems might arise if they are non-reversible).
Check that everything will go smoothly beforehand. Usually, the composite event is triggered by a "restart" of some other singleton event (e.g., the action of adding a regulation results in a restart, creating a composite action of adding the regulation + adding the corresponding static property). The initial event can check all the conditions before the restart itself (but some might be missed).
The undo/redo event stack currently supports actions consisting of several individual events. However, if one of these events fails, the application can get into an inconsistent state (where some changes were already made, but others were not). We should address this - so far, the following options have come to my mind: