Vendor callouts are not sent for all configured vendors from the page even when vendor list is <= 5
What's the issue?
Vendor callouts are not sent for all configured vendors from the page even when vendor list is <= 5
Briefly describe the bug.
We noticed a drop in incoming requests from our AMP customers starting 16:45 UTC on 17th Feb, 2021. On investigating we found an issue where the vendor callouts were not sent for all configured vendors from the page. We identified that there are duplicate vendor callout urls added to the object seenUrls_ for the same vendor. This results in the following condition getting incorrectly triggered - Object.keys(this.seenUrls_).length == MAX_RTC_CALLOUTS.
Due to this few vendor callouts are skipped.
How do we reproduce the issue?
Steps to reproduce:
- Go to URL: here
- Open Chrome devtools
- Navigate to network tab
- There are 5 vendors who have been configured by the publisher. Details below
aps: https://aax.amazon-adsystem.com/e/dtb/bid?medianet : https://amprtc.media.net/rtb/getrtc?indexexchange: https://amp.casalemedia.com/amprtcopenwrap: https://ow.pubmatic.com/ampprebidappnexus:https://prebid.adnxs.com/pbs/v1/openrtb2/amp
- Only 3 out of 5 vendor call outs are made
Link to callout-vendor.js
Steps to debug:
- Open
real-time-config-impl.jsin source panel - Add a debug point inside
send()which is insideinflateAndSendRtc_() - Observe values for
this.seenUrls_, you will notice duplicate entries being added for a single vendor as seen in the screenshot attached and observed values below

this.seenUrls_ = {
"https://aax.amazon-adsystem.com/e/dtb/bid?src=3023&pubid=PUB_UUID&=1&u=https%3A%2F%2Fwww.foxnews.com%2Ftech%2Felection-meddling-by-iran-russia-china-to-amp-up-prior-to-presidential-election&slots=%5B%7B%22sd%22%3A%22%2F4145%2Ffnc%2Famp%2Ftech%2Fban1%22%2C%22s%22%3A%5B%22320x250%22%5D%2C%22ms%22%3A%22320x50%2C300x250%2C300x50%22%7D%5D&pj=%7B%22amp%22%3A%221%22%7D&gdprc=": true,
"https://amp.casalemedia.com/amprtc?v=1&w=320&h=250&ow=&oh=&ms=320x50%2C300x250%2C300x50&s=410316&p=https%3A%2F%2Fwww.foxnews.com%2Ftech%2Felection-meddling-by-iran-russia-china-to-amp-up-prior-to-presidential-election&consent_state=&consent_string=": true,
"https://ow.pubmatic.com/amp?v=1&w=320&h=250&ms=320x50%2C300x250%2C300x50&auId=%2F4145%2Ffnc%2Famp%2Ftech%2Fban1&purl=https%3A%2F%2Fwww-foxnews-com.cdn.ampproject.org%2Fv%2Fs%2Fwww.foxnews.com%2Ftech%2Felection-meddling-by-iran-russia-china-to-amp-up-prior-to-presidential-election.amp%3Fusqp%3Dmq331AQFKAGwASA%253D%26amp_js_v%3D0.1%23origin%3Dhttps%3A%2F%2Fwww.google.com%26cid%3D1%26prerenderSize%3D1%26visibilityState%3Dvisible%26paddingTop%3D32%26history%3D1%26p2r%3D0%26csi%3D1%26storage%3D1%26viewerUrl%3Dhttps%3A%2F%2Fwww.google.com%2Famp%2Fs%2Fwww.foxnews.com%2Ftech%2Felection-meddling-by-iran-russia-china-to-amp-up-prior-to-presidential-election.amp%26cap%3DnavigateTo%2Cfragment%2Chandshakepoll%2Ccid%2CreplaceUrl%2CfullReplaceHistory&pubId=158583&profId=2349": true,
"https://aax.amazon-adsystem.com/e/dtb/bid?src=3023&pubid=PUB_UUID&=1&u=https%3A%2F%2Fwww.foxnews.com%2Ftech%2Felection-meddling-by-iran-russia-china-to-amp-up-prior-to-presidential-election&slots=%5B%7B%22sd%22%3A%22%2F4145%2Ffnc%2Famp%2Ftech%2Fban2%22%2C%22s%22%3A%5B%22320x250%22%5D%2C%22ms%22%3A%22320x50%2C300x250%2C300x50%22%7D%5D&pj=%7B%22amp%22%3A%221%22%7D&gdprc=": true,
"https://amp.casalemedia.com/amprtc?v=1&w=320&h=250&ow=&oh=&ms=320x50%2C300x250%2C300x50&s=410317&p=https%3A%2F%2Fwww.foxnews.com%2Ftech%2Felection-meddling-by-iran-russia-china-to-amp-up-prior-to-presidential-election&consent_state=&consent_string=": true
}
What browsers are affected?
All browsers
Which AMP version is affected?
Amp Version: 2102060044001
This seems related too https://github.com/ampproject/amphtml/issues/32715
The root cause is that https://github.com/ampproject/amphtml/pull/32386 uses a single instance of RTCManager for all elements on one page. Therefore rtc invocations are accumulated, causing this error.