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

Deepen stack of pending changes #8770

Open
nijel opened this issue Feb 9, 2023 · 0 comments
Open

Deepen stack of pending changes #8770

nijel opened this issue Feb 9, 2023 · 0 comments
Labels
enhancement Adding or requesting a new feature.

Comments

@nijel
Copy link
Member

nijel commented Feb 9, 2023

Describe the problem

Currently, Weblate tracks pending state per unit - whether current state needs to be written out to the file. This causes performance issues in several places, as pending changes might have to be written out before doing other edits:

  • Accepting and editing suggestions triggers commit
  • Bulk edit triggers commit
  • Two users editing translation at the same time triggers a lot of commits
  • Add-ons working on a single translation can cause a lot of commits
  • Serialization issues can lead to discarding change (see translation: skip strings which can not be serialized #10106)

Describe the solution you'd like

  • Use Change for tracking pending changes, add any missing info to details there, Unit would need just pending_changes = models.ManyToManyField("Change").
  • Utilize this to commit pending changes
  • Drop written out relations

Describe alternatives you've considered

  • Dedicated model tracking pending changes (unit, target, state, author, timestamp) could be used instead of relying on Change

Screenshots

No response

Additional context

  • Should be designed with Do not commit changes for a translation that needs approval from a reviewer #3745 in mind
  • User user_commit_pending should be refactored to use the new model
  • Not sure what to do with the pending flag, it would still simplify the lookup, but it duplicates the information, leading to possible consistency issues. Dropping field on the table might be expensive during the migration (but we might be changing the Units table anyway to add relation to Change).
  • Enforced checks handling will have to be adjusted so that the final state is stored as pending change, not desired one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant