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

Introduce internal transaction-like API for element mutations #7942

Open
Mrazator opened this issue Apr 24, 2024 · 0 comments
Open

Introduce internal transaction-like API for element mutations #7942

Mrazator opened this issue Apr 24, 2024 · 0 comments
Labels
refactor code refactor or rewrite needed without changing behavior

Comments

@Mrazator
Copy link
Collaborator

Within a certain action, we should have UoW-like possibilities for doing everything (in a transaction) or doing nothing (rollback to the previous state), so that we don't end up in an inconsistent state in between mutations.

  1. Either perform all mutations or none (perform a rollback)
  2. Don't allow mutating one element multiple times within the same transaction (~limit unnecessary version bumps)

The first step towards mimicking such behavior was done in #7348 as part of the applyTo logic, where either all increments are applied or none (while rolling back to prevElements). Check the details inside:

// mimic a transaction by applying deltas into `nextElements` (always new instance, no mutation)

@Mrazator Mrazator added the refactor code refactor or rewrite needed without changing behavior label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor code refactor or rewrite needed without changing behavior
Projects
None yet
Development

No branches or pull requests

1 participant