Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report)【A rather serious issue】 The notes are experiencing automatic snapshot recovery, and the edited content does not have any historical records. #831

Open
nvcutrb opened this issue Dec 24, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@nvcutrb
Copy link

nvcutrb commented Dec 24, 2024

Description

After editing the current note, switch to another note first, and then switch back to find that the content of the note has returned to the way it was edited at the beginning, as if a snapshot has been restored.

TriliumNext Version

v0.90.12

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows 10 pro

Error logs

No response

@nvcutrb
Copy link
Author

nvcutrb commented Dec 24, 2024

The entire application itself did not encounter any errors, and when switching notes, it seemed like the cache of edited content was lost and the information was not successfully saved. You can imagine if you have been working hard for over an hour, and the act of switching notes results in all content being lost and becoming blank.
整个应用本身并没有出现报错,在切换笔记时像是丢失了编辑内容的缓存,并没有成功保存信息。你可以想象一下如果辛苦的忙活了一个多小时,结果一个切换笔记的行为导致所有内容丢失,变成空白的样子。

@nvcutrb
Copy link
Author

nvcutrb commented Dec 24, 2024

Moreover, it seems that the entire snapshot function does not take snapshots when switching to other notes or when not selected, and there is no way to manually take snapshots.

@Nriver
Copy link
Member

Nriver commented Dec 24, 2024

  1. Are you using only a web server, or a combination of server and clients?
  2. Providing more logs would be helpful for analysis.
  3. Consider using forceSaveRevision. Assign a shortcut to it to save revisions manually.

@nvcutrb
Copy link
Author

nvcutrb commented Dec 24, 2024

We are using the Windows portable client
Can you take a look at this log?
log.txt

@nvcutrb
Copy link
Author

nvcutrb commented Dec 24, 2024

During the process of checking the logs, I found some other errors, so I decided to send all the logs.
log2.txt

@nvcutrb
Copy link
Author

nvcutrb commented Dec 24, 2024

I hope it can help you solve the problem.

@eliandoran
Copy link
Contributor

@nvcutrb , most likely you have run into a CKEditor (the text editor library we are using) failure. This issue is very hard to reproduce and we haven't been able to reproduce it yet, generally it happens when you copy-paste. The data loss is caused by the editor no longer providing us with the changes; there is a protection in place but it seems that for you it failed.

Also it seems to have a syntax highlighting widget, could you please get rid of it? TriliumNext includes built-in syntax highlight, any external module might interfere with it:

14:14:17.873 JS Error: Execution of JS note "SyntaxHighlightWidget 代码高亮组件" with ID NHy5HnUxu4fD failed with error: Load of script note "SyntaxHighlightWidget 代码高亮组件" (NHy5HnUxu4fD) failed with: BalloonEditor is not defined
Stack: Error
    at Object.y [as logError] (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:139076)
    at Object.h [as showAndLogError] (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:127992)
    at executeBundle (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:54234)
    at async Object.getWidgetBundlesByParent (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:55370)

The name of the note you need to remove is "SyntaxHighlightWidget 代码高亮组件". There's no guarantee it's the cause of error, but it should help us rule any external factors.

Let us know if you encounter this issue again.

@nvcutrb
Copy link
Author

nvcutrb commented Dec 24, 2024

Okay, I'll disable this component first and use it for a while later.

,则很可能您遇到了 CKEditor(我们正在使用的文本编辑器库)故障。此问题很难重现,我们还无法重现它,通常发生在您复制粘贴时。数据丢失是由于编辑器不再向我们提供更改造成的;有一个保护措施,但对您来说似乎失败了。

此外,它似乎有一个语法高亮小部件,您能去掉它吗?TriliumNext 包含内置的语法高亮,任何外部模块都可能干扰它:

14:14:17.873 JS Error: Execution of JS note "SyntaxHighlightWidget 代码高亮组件" with ID NHy5HnUxu4fD failed with error: Load of script note "SyntaxHighlightWidget 代码高亮组件" (NHy5HnUxu4fD) failed with: BalloonEditor is not defined
Stack: Error
    at Object.y [as logError] (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:139076)
    at Object.h [as showAndLogError] (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:127992)
    at executeBundle (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:54234)
    at async Object.getWidgetBundlesByParent (http://127.0.0.1:37840/assets/v0.90.12/app-dist/desktop.js:1:55370)

您需要删除的注释的名称是 “SyntaxHighlightWidget 代码高亮组件”。不能保证这是错误的原因,但它应该可以帮助我们排除任何外部因素。

如果您再次遇到此问题,请告诉我们。

@eliandoran eliandoran added the bug Something isn't working label Dec 27, 2024
@process
Copy link

process commented Jan 6, 2025

Possible dupe of #454?


Is there a way to do a custom local build of trilium-ckeditor5? I got npm run build:dist running in that project, but when I copy the dist/browser/index.js to libraries/ckeditor/ckeditor.js, I get "CKEditor is not defined" in the console. I feel I might be missing something obvious.

My thought is that we could try to get a repro working with some additional logging in CKEditor, and then possibly find better ways of detecting this sort of case. I don't have a repro yet, but it seems that it would be progress even to have a "fake" repro where we induce in a crash in CKEditor to force this state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants