amp-ad-network-doubleclick Cannot read property 'map' of undefined
TypeError: Cannot read property 'map' of undefined
at https://cdn.ampproject.org/rtv/001482359659944/v0/amp-ad-network-doubleclick-impl-0.1.js:78:221
Not sure who to send to. @keithwrightbos ?
This is because https://github.com/ampproject/amphtml/blob/ec703a549a0c1fc024100150f2738fabe2779c66/extensions/amp-a4a/0.1/amp-a4a.js#L874 and https://github.com/ampproject/amphtml/blob/ec703a549a0c1fc024100150f2738fabe2779c66/extensions/amp-a4a/0.1/amp-a4a.js#L866 return an object without a keys array.
Will look into it. Thanks
On Wed, Jan 4, 2017, 6:10 PM Justin Ridgewell [email protected] wrote:
Assigned #6875 https://github.com/ampproject/amphtml/issues/6875 to @keithwrightbos https://github.com/keithwrightbos.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/6875#event-911943709, or mute the thread https://github.com/notifications/unsubscribe-auth/ABr0LxbLrmse1Y7zgk7QRdMghyWGjHgPks5rPCbogaJpZM4LbJH5 .
Okay, I see the issues that @jridgewell is pointing to and I can probably do a quick fix. But I'd also like to add tests around it. @muxin : How was this triggered? Do you have some code that reproduces?
Issue occurs if fetchJson to get the crypto public keys fails (likely due to network error). We should create a test verifying this behavior and fix by ensuring default object returned in catch includes empty keys array. Thanks @tdrl for taking lead!
I cannot reproduce it by following the link that reported the error, but the error happens every now and then since last canary release (1482359659944). Also saw error logs:
TypeError: Cannot read property 'map' of undefined
at https://cdn.ampproject.org/rtv/001482359659944/v0/amp-ad-network-adsense-impl-0.1.js:78:221
When one small fix turns into a refactor and a new test suite...
This is taking longer than hoped. (On the plus side, it's uncovering some edges that we hadn't tested well, so is pushing us to improve. Yay?)
I hope you're not blocking a canary or release on this. It's a low-threat failure case in the wild b/c even when network errors occur, the key request gets re-issued later so there's a chance for recovery.
Thanks for looking into it. We're not blocking the release on this.
The fix will go into next canary release (current canary doesn't include this).