Skip to content

fix: don't silently drop outside changes (e.g. from external storage) - #9518

Merged
max-nextcloud merged 3 commits into
mainfrom
fix/external_changes_conflict
Nov 4, 2026
Merged

max-nextcloud merged 3 commits into
mainfrom
fix/external_changes_conflict

Conversation

@mejo-

@mejo- mejo- commented Nov 3, 2026

Copy link
Copy Markdown
Member

📝 Summary

See commit messages for details.

  • fix(sync): reset outdated document when the file changed outside of Nextcloud
  • fix(sync): show conflict dialog when saving fails with 409
  • test(playwright): test conflict resolution on outside changes

Fixes: #9236

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

…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
@mejo- mejo- self-assigned this Nov 3, 2026
@mejo- mejo- added bug Something isn't working 3. to review regression labels Nov 3, 2026
@mejo-
mejo- requested a review from max-nextcloud as a code owner November 3, 2026 17:35
@mejo-
mejo- requested a review from silverkszlo as a code owner November 3, 2026 17:35
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Nov 3, 2026
@mejo-

mejo- commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

/backport to stable35

@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 3, 2026
@mejo-

mejo- commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Also needs a backport to stable34, but let's see whether the backport to stable35 applies cleanly first. Also the backport to stable34 needs the etag/mtime early return in assertNoOutsideConflict() removed as well according to Claude. Will look into this later.

@mejo- mejo- moved this from 🧭 Planning evaluation (don't pick) to 👀 In review in 📝 Productivity team Nov 3, 2026
mejo- added 2 commits November 3, 2026 22:35
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
@mejo-
mejo- force-pushed the fix/external_changes_conflict branch from 652dd19 to 9a0ae56 Compare November 3, 2026 21:35
@max-nextcloud
max-nextcloud merged commit 5c015f9 into main Nov 4, 2026
68 of 70 checks passed
@max-nextcloud
max-nextcloud deleted the fix/external_changes_conflict branch November 4, 2026 08:58
@github-project-automation github-project-automation Bot moved this from 👀 In review to ☑️ Done in 📝 Productivity team Nov 4, 2026
@mejo-

mejo- commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Backport to stable34: #9539

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

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

Text app does not detect changed files on external ressources

3 participants