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

Add server logging for CKEditor state changes #941

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

process
Copy link
Contributor

@process process commented Jan 14, 2025

For #454 and #831, it would be useful to have logging about the state of the CKEditor in the server logs. This could help give us better understanding of frontend crashes, and other weird frontend state.

@@ -165,7 +165,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
return;
}

console.log(`CKEditor changed to ${currentState}`);
logInfo(`CKEditor changed to ${currentState}`)

this.watchdog.crashes.forEach(crashInfo => console.log(crashInfo));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without having an idea about the internals of CKEdiitor, but would it make sense to also send the "crashInfo" to the server logs?

Copy link
Contributor Author

@process process Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good idea. Unfortunately I think many of these crashes might have confusing traces of minimized code, but given the importance of CKEditor, it's worth it to have as much information as possible.
These crashes are rare.

I added a string log to send to the backend, and kept the console.log for easier viewing in the console.

@process
Copy link
Contributor Author

process commented Jan 14, 2025

Just rebased on develop 👍
Sorry, my local branch was very out of date 🙈

Copy link
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems nice, thanks.

@eliandoran eliandoran merged commit 3c0e4b8 into TriliumNext:develop Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants