Title heading sync broken - Failed to push steps
Please make a clear and concise description of what the bug is.
Steps to reproduce
- Create new note
- Set
# Heading - Save note
- Click another note
- See error console
Expected behaviour
No error in console. Title of Note, on left side is updated with first line of note
Actual behavior
Error in console
Happens in Firefox 139.0.4 and Brave 1.78.102
Errors/Logs
[ERROR] text: Failed to push the steps to the server Object { app: "text", uid: "xxxxxxxxxx", level: 2, stack: "J@https://my.server.com/apps/text/js/text-editors.js?v=2ed0fdb7-33:2:176176\nNe@https://my.server.com/apps/text/js/text-editors.js?v=2ed0fdb7-33:2:187597\nv@https://my.server.com/apps/text/js/text-editors.js?v=2ed0fdb7-33:2:192273\n", message: "Request failed with status code 403", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, … }
[ERROR] text: failed to write to document - not allowed Object { app: "text", uid: "xxxxxxxxxx", level: 2 }
[ERROR] text: Unexpected Error "Failed to apply steps. Retry!" Object { app: "text", uid: "xxxxxxxxxx", level: 2, error: Error }
Server
Notes app version: 4.12.1
Nextcloud version: 29.0.16, 30.0.11, 31.0.2
OS: Ubuntu 22.04
Web server (from outside to nextcloud): Apache 2.4.x
PHP version: PHP 8.1.x
Database: 10.6.x
Nextcloud configuration:
Workaround
Downgrading Notes to 4.11.0 solves the problem, only in 29.0.16
See also #7144
We can confirm this bug for Nextcloud 30.0.11. Downgrading to Note 4.11.0 doesn't solve the problem in 30.0.11
Never upgraded to 4.12.0, still on 4.11.0 and also notice sync issues, it does not always sync the texts?
Note this only seems to affect the WYSIWYG editor?
Nextcloud Hub 10 (31.0.2)
Problem still persists with Notes 4.12.1
We can confirm this issue for Nextcloud 30.0.12
The notes app acts as if the "files:node:updated" event is never emitted by the text app.
In Nextcloud 29, text app should emit "files:file:updated" on file saving. In Nextcloud 30 and 31, text app should emit "files:node:updated" on file saving.
The notes 4.12.* versions wait for "files:node:updated" event to update the note title, so these versions must not be compatible with Nextcloud 29. The notes 4.11.* versions wait for "files:file:updated" event to update the note title, so these versions must not be compatible with Nextcloud 30 and higher.
It seems that the text app never emits this "files:node:update" event in Nextcloud 30 and later.
After adding some tracing code, I confirm that the text application never emits the files:node:updated event because the editor's nodeId attribute is always null (even if the user is editing an existing file).
text/src/components/Editor.vue
...
onSave() {
if (this.fileNode) {
this.fileNode.mtime = new Date()
emit('files:node:updated', this.fileNode)
}
...
}
...
Next step: find why this attribute is always null. Is it a notes app issue or a text app issue ?
Here is the change which migrates to files:node:updated: https://github.com/nextcloud/text/commit/3da9c1095fd777e6a0b011c562c29e47eac99f5f
Before this change text only emit('files:file:updated', { fileid: this.fileId }), maybe this is cause of the issue?
I think this issue is related to the text app. I've added some more information in issue https://github.com/nextcloud/notes/issues/1598
https://github.com/nextcloud/notes/issues/1598
https://github.com/nextcloud/notes/issues/1598
The current issue will be resolved when the two fixes mentioned in the following comment are applied and released: https://github.com/nextcloud/notes/issues/1598
@gaudryc thank you very much for the patch.
I've tested both patches with nextcloud 30.x and can confirm, that they solve this issue.
Your welcome.
Don't forget about Nextcloud support when you will prepare the next release. Notes 4.12.0 and later only supports Nextcloud 30 and later.
https://github.com/nextcloud/notes/pull/1580 fixes nextcloud/text#1538
Please pay attention to this comment.
This bug cannot be fully resolved because the Notes app is still not compatible with Nextcloud 29. Version 4.12.2 still listens for the "files:node:updated" event, but the text app under Nextcloud 29 continues to send the "files:file:updated" event.
For anyone who has encountered this issue, please stay on version 4.11.0 on Nextcloud 29.
@gaudryc if it is still a compatibility issue I guess it's best to report it in a new issue.