Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Risk condition in action queue flush #8702

Closed
dvoytenko opened this issue Apr 11, 2017 · 0 comments
Closed

Risk condition in action queue flush #8702

dvoytenko opened this issue Apr 11, 2017 · 0 comments

Comments

@dvoytenko
Copy link
Contributor

The PROD error looks like this:

TypeError: e.forEach is not a function
at (https://cdn.ampproject.org/rtv/001491864594241/v0.js:196)
at (https://cdn.ampproject.org/rtv/001491864594241/v0.js:288)

Refers to this line:

currentQueue.forEach(invocation => {

The most likely culprit is risk condition. It's tested in this line:

dev().assert(

However, since dev.assert-s are removed from PROD binaries, we never see this error and instead observe the error shown above.

Judging by the code, this is a very clear risk condition and the fix would be to simply short-circuit when the queue is no longer an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants