ckeditor / ckeditor5-react

Official CKEditor 5 React component.
https://ckeditor.com/ckeditor-5
Other
425 stars 99 forks source link

Restore restarted watchdog editor with current react state #546

Closed Mati365 closed 1 month ago

Mati365 commented 1 month ago

Suggested merge commit message (convention)

Fix: Prevent potential crashes of useMultiRootEditor during the initialization phase when setting the new state of the multi-root editor with an attached watchdog. Closes https://github.com/ckeditor/ckeditor5-react/issues/542


Additional information

It appears that some of our tests are causing random restarts of the editor. An example of such a restart might occur when setting some data while the component has not fully rendered the entire CKEditor, and the semaphore begins destroying it while running in the watchdog context.

This PR resets the reinitialized editor data to the one defined in the React state (data is defined in the upper scope). This change seems to make our tests more stable and should be harmless.

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build e60bbb33-6ee8-42a4-9a3f-558ebc50367c

Details


Totals Coverage Status
Change from base Build 99f1a8b3-7db2-4b7a-b3cb-6130df28e2ca: 0.0%
Covered Lines: 582
Relevant Lines: 582

💛 - Coveralls
Mati365 commented 1 month ago

@f1ames I don't think so, simulating this is too difficult, and it's that kind of behavior that often changes with React implementation changes.