-
Notifications
You must be signed in to change notification settings - Fork 2
[WIP] Introduce the ContextWatchdog #33
Conversation
… EditorWatchdog class.
docs/features/watchdog.md
Outdated
* `crashNumberLimit` - A threshold specifying the number of editor errors (defaults to `3`). After this limit is reached and the time between last errors is shorter than `minimumNonErrorTimePeriod` the watchdog changes its state to `crashedPermanently` and it stops restarting the editor. This prevents an infinite restart loop. | ||
* `minimumNonErrorTimePeriod` - An average amount of milliseconds between last editor errors (defaults to 5000). When the period of time between errors is lower than that and the `crashNumberLimit` is also reached the watchdog changes its state to `crashedPermanently` and it stops restarting the editor. This prevents an infinite restart loop. | ||
<info-box> | ||
Examples presents the "synchronous way" of the integration with the context watchdog feature, however it's not needed to wait for the promises returned by the `create()`, `add()` and `remove()` methods. There might be a need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this info box, to be honest. I don't know what you wanted to convey here and whether it is actually important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to say that the promises are chained anyway so there's no need to wait for these promises as some integrations may require running multiple add()
and remove()
functions in the watchdog at the same time.
I see that in How about "watched object" or "watched item" instead? |
Three thoughts.
|
I don't like it. The
I added it, not changed, so maybe there would be a chance to create watchdog items in the more generic way. But I can change it to the watchdog item.
Then in case of the custom creator you'd have to pass two things there. That's why I'm not sure about this idea. |
Make watchdog not dependent on other CKEditor 5 packages
Suggested merge commit message (convention)
Feature: Introduce the
ContextWatchdog
which will be a new watchdog for theContext
feature and the main watchdog for multi-editor scenarios sharing theContext
instance. Closes ckeditor/ckeditor5#6079. Closes ckeditor/ckeditor5#6042. Closes ckeditor/ckeditor5#4696.TODO:
Watchdog
be renamed toEditorWatchdog
? This would be a BC (But we'll have other BC anyway in this release in this package).remove
accept array of strings and string?Additional information
BREAKING CHANGE: The
Watchdog
class was renamed to theEditorWatchdog
class and is available in thesrc/editorwatchdog.js
file.BREAKING CHANGE: The
EditorWatchdog.for()
method was removed in favor of the constructor.BREAKING CHANGE: The
EditorWatchdog#constructor()
API changed, now theEditorWatchdog
accepts the editor class as the first argument and the watchdog configuration as the second argument.The
EditorWatchdog
editor creator now defaults to(sourceElementOrData, config ) => Editor.create( sourceElementOrData, config )
Side note: I duplicated the
getSubNodes()
andareConnectedThroughProperties()
functions and copied and modified them in the Watchdog repository having ckeditor/ckeditor5#4699 in mind.