derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 116 forks source link

Shallow clone refs value to avoid trying to access removed ref #267

Closed lesliepearson closed 5 years ago

lesliepearson commented 5 years ago

When we have multiple listeners and one is removed before the other one is added, we run into an issue where the loop is trying to access an element of the refs array when it no longer exists.

Solution for the time being is to use a shallow clone of refs

lesliepearson commented 5 years ago

thanks for looking into this with me and adding a test! test looks good!

@jeremymcintyre - in case you are interested b/c we were looking into this together yesterday.

ericyhwang commented 5 years ago

Published in racer@0.9.8