Temasys / SkylinkJS

SkylinkJS Javascript WebRTC SDK
http://skylink.io/web
Other
275 stars 57 forks source link

When multiple once event handlers are added, only some are fired #62

Closed mhofman closed 9 years ago

mhofman commented 9 years ago

The event trigger logic for once events sometimes splice the once array, which means the iteration loop gets out of sync and skips some entries.

Repro (pseudo code):

var skylink = new Skylink();
skylink.init();
skylink.getUserMedia();
// Wait for init to complete
skylink.joinRoom('roomName', {}, function() {
    // Callback is never called because it internally uses a once that never triggers
});
oooookk7 commented 9 years ago

Hi @mhofman thanks for pointing it out. We are working on a fix for it. Next release version should contain the fix. :)