Repository navigation
[stable35] fix(sync): improve situation around false conflicts - #9547
Merged
Merged
Conversation
A save request loads the document before checking for outside changes. If another save by Text finished in between, the file checksum no longer matched the loaded document and the save was rejected with 409, which now shows the conflict dialog. Before reporting a conflict, reload the document and only treat the change as outside if the stored checksum still differs from the file. Continue with the reloaded document so the following checks see the version saved in the meantime. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
After writing the file, the checksum was computed by reading the file again and stored only after the document state. A lock on the file or a failure while writing the state left the previous checksum behind, so every following save was rejected as a conflict. Reading the file again could also pick up an outside change written right after the save and hide the conflict. Compute the checksum from the content Text just wrote and store it right after writing the file. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
The conflict check reads the whole file to compute its checksum, also for autosaves that are then dropped because the last save was less than AUTOSAVE_MINIMUM_DELAY seconds ago. Return early for those autosaves before checking for conflicts. They do not write anything, so skipping the check cannot overwrite outside changes. Manual saves are not throttled and are still checked. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
backportbot
Bot
requested review from
max-nextcloud,
mejo- and
silverkszlo
as code owners
November 4, 2026 20:16
mejo-
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #9542