Closed royaltm closed 8 years ago
Long story short: this really ruined my night: https://github.com/scottwrobinson/camo/blob/b2bd9846234a1fe969e4f8385cdcf7ba66fffc5a/lib/base-document.js#L541
The typeless at its worst...
this will push an array with (a possible) promise into an array
hookPromises.push(_.invoke([this], hookName));
resulting in [[promise]] instead of [promise]
[[promise]]
[promise]
and this is bad, because Promise.all([[promise]]) immediately succeeds.
Promise.all([[promise]])
So any error in ANY of this document hook's promise will be (possible silently) discarded!
why just not
hookPromises.push(this[hookName]());
or at least:
hookPromises = hookPromises.concat(_.invoke([this], hookName));
Thanks for bringing this up. I should be able to try out your fix tomorrow.
Thanks!
Also, if you can post any code that shows the error that would be great. Thanks!
here you go
Long story short: this really ruined my night: https://github.com/scottwrobinson/camo/blob/b2bd9846234a1fe969e4f8385cdcf7ba66fffc5a/lib/base-document.js#L541
The typeless at its worst...
this will push an array with (a possible) promise into an array
resulting in
[[promise]]
instead of[promise]
and this is bad, because
Promise.all([[promise]])
immediately succeeds.So any error in ANY of this document hook's promise will be (possible silently) discarded!
why just not
or at least: