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
ViewCollection.add( child ) returns a promise but it doesn't belong to editor.create() and editor.destroy() chain. So it is possible to destroy the editor when ViewCollection.add( child ) promise is working (i.e. child.init() takes a long time to finish).
Each promise created by ViewCollection.add( child ) should be remembered in the property of the VC like this._addPromises = [ promises for each add() ] and removed from the array once resolved so when ViewCollection.destroy() is called, it should wait for Promise.all( this._addPromises ) to finish.
I believe @scofalik has recently run into this problem (and it might've been in the link tests). I think I was meant to report it but I can't see a ticket for that so... I'm glad you run into this too :P
Not exactly but It was our first thought too. ckeditor/ckeditor5-link#94 was because I was trying to test asynchronous code by the synchronous test. The assertion was in the first event loop but the code was finishing asynchronous and the error occurred in the next events loop just after the test has finished. It has no impact to assertion but It was produced an error.
ViewCollection.add( child )
returns a promise but it doesn't belong toeditor.create()
andeditor.destroy()
chain. So it is possible to destroy the editor whenViewCollection.add( child )
promise is working (i.e.child.init()
takes a long time to finish).Each promise created by
ViewCollection.add( child )
should be remembered in the property of theVC
likethis._addPromises = [ promises for each add() ]
and removed from the array once resolved so whenViewCollection.destroy()
is called, it should wait forPromise.all( this._addPromises )
to finish.A follow-up of ckeditor/ckeditor5-link#104.
The text was updated successfully, but these errors were encountered: