Replies: 2 comments 3 replies
-
The purpose of So what you most likely observe is that Can you please elaborate a bit more on your setup? What file format do you use? What component configuration? Can you share logs from the overwrite of the translations? PS: The |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the issue
Weblate overwrites uncommitted local translation changes when syncing from Git repository, causing translator work to be permanently lost. This happens because the
needs_commit_upstream()
method only checks for Git file changes but ignores pending translation changes in the Weblate database.I already tried
Steps to reproduce the behavior
pending=True
)needs_commit_upstream()
returnsFalse
because no Git files have changedExpected behavior
Expected behavior
Weblate should protect uncommitted local changes during repository sync by:
Actual behavior
Pending translation changes are silently overwritten and lost during repository sync, with no warning or recovery mechanism.
Root cause analysis
The issue is in the
needs_commit_upstream()
method inweblate/trans/models/component.py
:This method only examines Git repository file changes, completely ignoring pending translation units in the Weblate database that haven't been written to files yet.
Evidence from our logs
We observed this behavior in our production instance:
Suggested fix
Modify
needs_commit_upstream()
to also check for pending database changes:Impact
This is a critical data loss bug that can result in:
Environment
Additional context
This issue particularly affects workflows where:
commit_pending_age
is set to longer periods (default 24 hours)AUTO_UPDATE
)The problem is exacerbated by Weblate's hourly sync schedule (
update_remotes
task), which can trigger before the 24-hour commit timeout expires.Screenshots
Pending translation changes are silently overwritten and lost during repository sync, with no warning or recovery mechanism.
Exception traceback
How do you run Weblate?
Docker container
Weblate versions
weblate 5.10.4
Weblate deploy checks
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions