fix: reconcile direct-edit and plain-edit baselines to avoid false conflict dialog - #3271
fix: reconcile direct-edit and plain-edit baselines to avoid false conflict dialog#3271mvanhorn wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
How can I reproduce this issue? Am I missing something? I guess pressing that FAB is switching between rich and plain edit mode? Screen_recording_20260810_103410.webm |
|
Yes, the FAB is the mode switch. The dialog doesn't fire on every toggle though, which is likely why your recording looks clean. The trigger is switching modes before the previous mode's sync finishes, so the plain editor and the Text direct-edit session end up with different baselines. Repro that works reliably (from #2196, reconfirmed by @truAlexeyRu on 2026-06-30):
Without the patch you get the "document has been changed outside of the editor" dialog even though both versions are identical. With the patch both paths reconcile against the same saved baseline on load, so an unmodified switch no longer counts as an outside change; a genuine outside edit still raises the dialog. |
Switching a note between plain edit and rich (direct) edit repeatedly no longer triggers the Text editor's "The document has been changed outside of the editor" conflict dialog when the user made no changes.
Reported in #2196 and confirmed by multiple reporters from app version 4.2.1 (2024) through a fresh reproduction on 2026-06-30. Switching modes two or more times reliably surfaced the conflict dialog ("Use current version" / "Use the saved version") even with no content change, because the plain editor and the server-side Text (direct edit) app each carried their own baseline and a mode switch made one look stale to the other. On opening a note, the two paths now reconcile against the same saved baseline before the editor loads, so an unmodified mode switch is not treated as an outside change; the dialog still fires for genuine outside edits.
Fixes #2196
🖼️ Screenshots
No UI change — this fixes an incorrect conflict dialog that appeared during plain/rich edit mode switches. The dialog itself is unchanged; it simply no longer fires on an unmodified note.
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)