Closed gitolathe closed 8 years ago
we could also move the timeout being cleared to before the currentQueue is set to null or we could add a check for currentQueue not being null in cleanUpNextTick, though we should first probably let the internet explorer team know about this because this is almost certainly a bug on their part
we had a similar bug in firefox a while back that turned out to be due to window.open being called in a task causing that function to block but the timers were not blocked, so I wonder if there is anything in particular that is being enqueued in process.nextTick that might be interacting strangely here?
ok opened a bug with edge https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7206104/
@gitolathe any chance you could help the edge team reproduce https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7206104/ ?
anyway this should be fixed by #57 reopen if you continue to see it
Hi,
From time to time (very seldom, probably less than one of every million user sessions) we see the error
Error: Unable to get property 'length' of undefined or null reference
logged for a user and we tracked it to theif (currentQueue.length) {
statement incleanUpNextTick()
inbrowser.js
.It also seems like it's only affect users using IE 11, we have not seen this for FF or Chrome:
Our best guess of the root cause is that for some reason the timeout for
cleanUpNextTick
triggers after the row wherecurrentQueue
is set tonull
but before the timer been cancelled byclearTimeout
, i.e. some kind of race condition:A possible solution would be to replace
currentQueue = null;
withcurrentQueue = [];
unless you can identify any unintended consequences of such a change.