soney / arboretum

2 stars 0 forks source link

Initialize dom element event received after setChildren #13

Open MinaXenou opened 8 years ago

MinaXenou commented 8 years ago

This is a race condition issue. The problem is that,many times, the "childrenChanged" Event is received even before the node placeholding event. This has as a result that the node related to the childrenChanged Event is not yet stored in the nodemap and an "Error : could not find node" is thrown. As I can see the most of the errors are related to that kind of race conditions. Maybe one possible fix could be to use here also a queue with events related to a node which are not executed before the node initializations. Once the node is initialized (Registered in the nodemap) the execution of all the related events is fired.

MinaXenou commented 8 years ago

2016-08-27 18_58_24-myvm running - oracle vm virtualbox

This is an example of two nodes ( 3 and 4) that receive a childrenchanged event but are not placeholded nor initilized yet (you can see the placeholding and initialization events happening later for both nodes, I have also printed timestamps of the events)

soney commented 8 years ago

@MinaXenou hmm, does this happen in the code that emits the events as well?