trilium icon indicating copy to clipboard operation
trilium copied to clipboard

Possible frequent CKEditor crash

Open yu-jingrui opened this issue 2 years ago • 5 comments

Trilium Version

0.58.8

What operating system are you using?

Windows

What is your setup?

Local + server sync

Operating System Version

Window 11

Description

When writing in notes (with Chinese input method MS Pinyin), CKEditor possibly crashes frequently and restart. My cursor goes to the beginning of the note, and the last few words I typed disappear. This happens as frequent as about every 10 to 20 characters I type.

This is more severe than just cursor jumps to the beginning. After finishing a note, I closed trilium, reopened it and found only about 1/3 exists, even though I manually made a server sync just before I closed the window.

Error logs

14:49:42.104 JS Error: Uncaught error: Message: Uncaught CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid, URL: http://127.0.0.1:37840/#root/ZDaZkH5fhAwD/e2LQ11BxD1Lc/kdB2xv6apRbC/9WWp6ymRU8AG-dsQX, Line: 6, Column: 347725, Error object: {"name":"CKEditorError","context":{"baseVersion":1,"position":{"root":"main","path":[1,169],"stickiness":"toNone"},"nodes":[{"data":" "}],"shouldReceiveAttributes":true,"__className":"InsertOperation"}}, Stack: CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid at Kc._validate (:6:587038) at nh.on.priority (:6:665557) at nh.fire (:6:349341) at nh. [as applyOperation] (:6:353025) at Pd.insert (:6:641750) at Zd._insertPartialFragment (:6:658001) at Zd.handleNodes (:6:656573) at :6:667656 at nh.change (:6:666526) at :6:666928 Stack: Error at Object.N [as logError] (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:103715) at window.onerror (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:607706)

15:04:40.526 Nothing to push 15:04:40.636 Finished pull 15:04:40.636 Nothing to push 15:04:40.802 Content hash computation took 17ms 15:04:40.802 Content hash checks PASSED 15:04:40.802 Sending message to all clients: {"type":"sync-finished","lastSyncedPush":52406} 15:04:41.596 JS Error: Uncaught error: Message: Uncaught CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid, URL: http://127.0.0.1:37840/#root/ZDaZkH5fhAwD/e2LQ11BxD1Lc/kdB2xv6apRbC/9WWp6ymRU8AG-dsQX, Line: 6, Column: 347725, Error object: {"name":"CKEditorError","context":{"baseVersion":21,"position":{"root":"main","path":[1,431],"stickiness":"toNone"},"nodes":[{"data":" "}],"shouldReceiveAttributes":true,"__className":"InsertOperation"}}, Stack: CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid at Kc._validate (:6:587038) at nh.on.priority (:6:665557) at nh.fire (:6:349341) at nh. [as applyOperation] (:6:353025) at Pd.insert (:6:641750) at Zd._insertPartialFragment (:6:658001) at Zd.handleNodes (:6:656573) at :6:667656 at nh.change (:6:666526) at :6:666928 Stack: Error at Object.N [as logError] (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:103715) at window.onerror (http://127.0.0.1:37840/assets/v0.58.8/app-

yu-jingrui avatar Feb 20 '23 13:02 yu-jingrui

It might correlates to certain inputs. Just happened multiple times when I tried typing a word.

Error Logs

15:09:54.831 JS Error: Uncaught error: Message: Uncaught CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid, URL: http://127.0.0.1:37840/#root/ZDaZkH5fhAwD/e2LQ11BxD1Lc/kdB2xv6apRbC/9WWp6ymRU8AG-dsQX, Line: 6, Column: 347725, Error object: {"name":"CKEditorError","context":{"baseVersion":25,"position":{"root":"main","path":[1,463],"stickiness":"toNone"},"nodes":[{"data":" "}],"shouldReceiveAttributes":true,"__className":"InsertOperation"}}, Stack: CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid at Kc._validate (:6:587038) at nh.on.priority (:6:665557) at nh.fire (:6:349341) at nh. [as applyOperation] (:6:353025) at Pd.insert (:6:641750) at Zd._insertPartialFragment (:6:658001) at Zd.handleNodes (:6:656573) at :6:667656 at nh.change (:6:666526) at :6:666928 Stack: Error at Object.N [as logError] (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:103715) at window.onerror (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:607706) 15:09:57.394 JS Error: Uncaught error: Message: Uncaught CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid, URL: http://127.0.0.1:37840/#root/ZDaZkH5fhAwD/e2LQ11BxD1Lc/kdB2xv6apRbC/9WWp6ymRU8AG-dsQX, Line: 6, Column: 347725, Error object: {"name":"CKEditorError","context":{"baseVersion":1,"position":{"root":"main","path":[1,463],"stickiness":"toNone"},"nodes":[{"data":" "}],"shouldReceiveAttributes":true,"__className":"InsertOperation"}}, Stack: CKEditorError: insert-operation-position-invalid Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid at Kc._validate (:6:587038) at nh.on.priority (:6:665557) at nh.fire (:6:349341) at nh. [as applyOperation] (:6:353025) at Pd.insert (:6:641750) at Zd._insertPartialFragment (:6:658001) at Zd.handleNodes (:6:656573) at :6:667656 at nh.change (:6:666526) at :6:666928 Stack: Error at Object.N [as logError] (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:103715) at window.onerror (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:607706) 15:10:02.860 204 PUT /api/options with 0 bytes took 0ms .......(some other sync etc logs)....... 15:17:53.240 JS Error: Uncaught error: Message: ResizeObserver loop limit exceeded, URL: http://127.0.0.1:37840/#root/_hidden/_backendLog-jY9P, Line: 0, Column: 0, Error object: null, Stack: null Stack: Error at Object.N [as logError] (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:103715) at window.onerror (http://127.0.0.1:37840/assets/v0.58.8/app-dist/desktop.js:2:607706) 15:17:53.246 204 PUT /api/options with 0 bytes took 0ms 15:17:54.234 200 GET /api/backend-log with 156580 bytes took 2ms

yu-jingrui avatar Feb 20 '23 14:02 yu-jingrui

Tested on Arch Linux, trilium version 0.58.8 from AUR. No such behavior as on windows.

yu-jingrui avatar Feb 20 '23 16:02 yu-jingrui

Hello, unfortunately, CKEditor seems to have trouble with Chinese input. Please try the 0.59.0-beta. The editor will still crash, but it should recover in a way which doesn't lead to loss of data.

I hope that the CKEditor team will manage to fix these issues in the future.

zadam avatar Feb 20 '23 20:02 zadam

@zadam Thanks a lot for the reply. Curious whether it's because of the input method of windows 11 (was using windows 10) or the newer version CKEditor has some bug. Never had this problme when using 0.57.x on windows 10.

yu-jingrui avatar Feb 21 '23 07:02 yu-jingrui

TBH might be either of their combination. Apparently, fully internationalized input on the web is still extremely complex and often OS dependent.

zadam avatar Feb 22 '23 21:02 zadam

This bug is not showing anymore on 0.59.3.

yu-jingrui avatar Mar 28 '23 13:03 yu-jingrui