Skip to content

[stable34] fix: don't silently drop outside changes (e.g. from external storage) - #9539

Merged
mejo- merged 6 commits into
stable34from
backport/9530/stable34
Nov 4, 2026
Merged

mejo- merged 6 commits into
stable34from
backport/9530/stable34

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Backport of #9530

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Remove all the empty commits
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot
backportbot Bot requested a review from mejo- November 4, 2026 09:24
@backportbot backportbot Bot added bug Something isn't working 3. to review regression AI assisted This PR contains AI-assisted commits labels Nov 4, 2026
@backportbot backportbot Bot added this to the Nextcloud 34.0.6 milestone Nov 4, 2026
@mejo- mejo- changed the title [stable34] [stable35] fix: don't silently drop outside changes (e.g. from external storage) [stable34] fix: don't silently drop outside changes (e.g. from external storage) Nov 4, 2026
@mejo-
mejo- force-pushed the backport/9530/stable34 branch 2 times, most recently from 5f86a22 to e540d52 Compare November 4, 2026 15:28
@mejo-
mejo- marked this pull request as ready for review November 4, 2026 15:28
mejo- added 3 commits November 4, 2026 17:29
…extcloud

Writes that bypass Nextcloud, e.g. directly on external storage, do not
trigger the NodeWritten listeners, so a stored document and its yjs state
were reused when the file was opened again, and the editor showed outdated
content.

When opening a session, compare the stored checksum with the current file.
If it differs and the document has no unsaved changes, reset the document
so the client loads the current file content. Documents with unsaved
changes are kept so the conflict is raised on the next save.

Refs: #9236

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
Since conflicts are no longer reported by the sync endpoint, a save
rejected because the file changed outside of Text returned 409 with the
outside content, but SaveService ignored it. The editor kept retrying
silently and the changes were never saved.

Emit a SAVE_COLLISION error so the conflict resolution dialog is shown.

Refs: #9236

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
@blizzz

This comment was marked as resolved.

@mejo-

This comment was marked as resolved.

mejo- added 3 commits November 4, 2026 18:19
…re unchanged

On stable34, assertNoOutsideConflict() skipped the checksum comparison
when the file cache's etag and mtime matched the document. Files changed
directly on storage (e.g. external storage, filesystem_check_changes=0)
keep their cached etag/mtime, so the change went undetected and was
overwritten on save. Always compare the checksum, as stable35 does.

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
@mejo-
mejo- merged commit 8a1caa0 into stable34 Nov 4, 2026
70 checks passed
@mejo-
mejo- deleted the backport/9530/stable34 branch November 4, 2026 21:35
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 regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants