Skip to content

[stable35] fix(sync): improve situation around false conflicts - #9547

Merged
mejo- merged 3 commits into
stable35from
backport/9542/stable35
Nov 4, 2026
Merged

mejo- merged 3 commits into
stable35from
backport/9542/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 4, 2026

Copy link
Copy Markdown

Backport of PR #9542

mejo- added 3 commits November 4, 2026 20:16
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 backportbot Bot added bug Something isn't working 3. to review AI assisted This PR contains AI-assisted commits labels Nov 4, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.3 milestone Nov 4, 2026
@mejo-
mejo- merged commit c93384b into stable35 Nov 4, 2026
76 of 82 checks passed
@mejo-
mejo- deleted the backport/9542/stable35 branch November 4, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant