Skip to content
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

Error handling for composite events #42

Open
ondrej33 opened this issue Jun 7, 2024 · 0 comments
Open

Error handling for composite events #42

ondrej33 opened this issue Jun 7, 2024 · 0 comments

Comments

@ondrej33
Copy link
Member

ondrej33 commented Jun 7, 2024

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant