You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that <CKEditorContext> component doesn't destroy properly, as it keeps an open WebSocket connection after unmounting. For example, as a result, it leaves connected users in the presence list.
The easiest way to reproduce the problem is to use our Comments outside of the editor for React sample, where Context + RTC are integrated. The sample should be modified to allow component destruction. I have prepared a simple solution that adds a button for toggling editors - it could be used for the reproduction, just replace the original sample.js file with the one from my gist.
After creating the editors, the WebSocket connection is open, but after removing the editor, it is still open. This issue doesn't occur with the default <CKEditor> component or default Context integration.
Possible solution
Here is the part responsible for destroying the context after unmounting the component:
I noticed that converting this method to the async method fixes the issue and makes all asynchronous code from ContextWatchdog run properly (however, I don't know if it is a correct approach).
Description
It seems that
<CKEditorContext>
component doesn't destroy properly, as it keeps an open WebSocket connection after unmounting. For example, as a result, it leaves connected users in the presence list.The easiest way to reproduce the problem is to use our Comments outside of the editor for React sample, where Context + RTC are integrated. The sample should be modified to allow component destruction. I have prepared a simple solution that adds a button for toggling editors - it could be used for the reproduction, just replace the original
sample.js
file with the one from my gist.After creating the editors, the WebSocket connection is open, but after removing the editor, it is still open. This issue doesn't occur with the default
<CKEditor>
component or default Context integration.Possible solution
Here is the part responsible for destroying the context after unmounting the component:
https://github.com/ckeditor/ckeditor5-react/blob/master/src/ckeditorcontext.jsx#L82-L87
I noticed that converting this method to the async method fixes the issue and makes all asynchronous code from ContextWatchdog run properly (however, I don't know if it is a correct approach).
Before the change (see the dev tools and Time column of the WebSocket connection - it's pending after the destroy):
After the change:
The text was updated successfully, but these errors were encountered: