notes icon indicating copy to clipboard operation
notes copied to clipboard

Title heading sync broken - Failed to push steps

Open theroch opened this issue 8 months ago • 17 comments

Please make a clear and concise description of what the bug is.

Steps to reproduce

  1. Create new note
  2. Set # Heading
  3. Save note
  4. Click another note
  5. 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:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ```

Workaround

Downgrading Notes to 4.11.0 solves the problem, only in 29.0.16

theroch avatar May 06 '25 16:05 theroch

See also #7144

theroch avatar May 06 '25 16:05 theroch

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

theroch avatar May 23 '25 09:05 theroch

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)

rugk avatar May 27 '25 22:05 rugk

Problem still persists with Notes 4.12.1

theroch avatar Jun 03 '25 08:06 theroch

We can confirm this issue for Nextcloud 30.0.12

theroch avatar Jun 13 '25 07:06 theroch

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.

gaudryc avatar Jun 19 '25 14:06 gaudryc

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 ?

gaudryc avatar Jun 20 '25 09:06 gaudryc

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?

theroch avatar Jun 20 '25 10:06 theroch

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

theroch avatar Jun 24 '25 07:06 theroch

https://github.com/nextcloud/notes/issues/1598

gaudryc avatar Jun 24 '25 09:06 gaudryc

https://github.com/nextcloud/notes/issues/1598

gaudryc avatar Jun 24 '25 13:06 gaudryc

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 avatar Jun 24 '25 15:06 gaudryc

@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.

theroch avatar Jun 24 '25 16:06 theroch

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.

gaudryc avatar Jun 25 '25 07:06 gaudryc

https://github.com/nextcloud/notes/pull/1580 fixes nextcloud/text#1538

theroch avatar Jun 25 '25 19:06 theroch

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 avatar Jul 11 '25 10:07 gaudryc

@gaudryc if it is still a compatibility issue I guess it's best to report it in a new issue.

rugk avatar Aug 08 '25 21:08 rugk