-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
When prebid server issues a no-bid response, call addBidResponse for every adUnit requested #1204
When prebid server issues a no-bid response, call addBidResponse for every adUnit requested #1204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks good, just one slight update required.
src/adapters/prebidServer.js
Outdated
bidmanager.addBidResponse(bidObject.adUnitCode, bidObject); | ||
if (!bidder.ad_unit) { | ||
utils.getBidderRequestAllAdUnits(bidder.bidder).bids.forEach(bid => { | ||
let bidObject = bidfactory.createBid(STATUS.NO_BID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass through the bid
object as the 2nd param to createBid
so we can get the ID (see line 78 below as an example)
@mkendall07 fixed! I'm passing bid request object to createBid, also added new test into spec file to make sure that bid request id is used as bid's ad id. Also merged changes from master and changed code formating in accordance with the new liting rules |
@mkendall07 upon further testing I found that I missed few cases.
I'm not quite sure if I should adress these in the same PR or I can create a new one for that purpose. |
Example of the response for the first case below. Request included two different ad units. Can post full request payload too, if needed.
Server side has the following logic (pbs_light.go):
So if there's at least one bid, NoBid flag is not set. |
@mkendall07 added no bid response generation for the # 2 (when user sync is requested). Waiting for your review. And I'll add an issue for # 3 |
LGTM. Can you also open a ticket for #1 ? after review, I think this should be fixed in the adapter, but it can be separate PR. Thanks! |
…built * 'master' of https://github.com/prebid/Prebid.js: (23 commits) Increment pre version Probed 0.24.0 Release Beachfront adapter - add ad unit size (prebid#1183) Thoughtleadr adapter - fix postMessage (prebid#1207) When prebid server issues a no-bid response, call addBidResponse for every adUnit requested (prebid#1204) Improvement/timeout xhr (prebid#1172) Add native support (prebid#1072) Improvement/alias queue (prebid#1156) Updated documentaion (prebid#1160) Improvement/prebid iframes amp pages (prebid#1119) Fixes prebid#1114 possible xss issue (prebid#1186) Allowed setTargetingForGPTAsync() to target specific ad unit codes. (prebid#1158) updated tag (prebid#1212) Common user-sync (prebid#1144) Rename secureCreatives file and lint (prebid#1203) HIRO Media: Remove batching mechanism and use AJAX instead of JSONP (prebid#1133) Add Support for DigiTrust in Rubicon Adapter (prebid#1201) Upgrade linters to ESLint with stricter code style (prebid#1111) Add dynamic bidfloor parameter to Smart Adserver Adapter (prebid#1194) Bug fix: bids served by secure creatives does not get pushed into _winningBids (prebid#1192) ...
….23.0 to aolgithub-master * commit '136fc37637749a764070c35c03e7e87a5c157947': (33 commits) Added changelog entry. Implemented passing key values feature. Update code to ESlint rules. Prebid 0.24.1 Release tests: drop ie9 browserstack test Audience Network: separate size from format (prebid#1218) Bugfix/target filtering api fix (prebid#1220) Map sponsor request param to endpoint param (prebid#1219) Increment pre version Probed 0.24.0 Release Beachfront adapter - add ad unit size (prebid#1183) Thoughtleadr adapter - fix postMessage (prebid#1207) When prebid server issues a no-bid response, call addBidResponse for every adUnit requested (prebid#1204) Improvement/timeout xhr (prebid#1172) Add native support (prebid#1072) Improvement/alias queue (prebid#1156) Updated documentaion (prebid#1160) Improvement/prebid iframes amp pages (prebid#1119) Fixes prebid#1114 possible xss issue (prebid#1186) Allowed setTargetingForGPTAsync() to target specific ad unit codes. (prebid#1158) ...
…every adUnit requested (prebid#1204) * No bid response has no ad unit, create bid response for every ad unit requested To fix prebid#1196 * Test to cover cases when response has no bids * Pass through the bid object to link request and response * Some fixes to support new linting * Populated wrong field * Generate status NO_BID response if server requested usersync
Type of change
Description of change
Currently prebid-server issues single no-bid response for all the add units and the response doesn't have the ad unit code field (the only exception is indexExchange, server side has different logic just for this bidder). Yet addBidResponse is being called and this non-existing field is passed as it's first argument. addBidResponse rejects such call, so prebid keeps waiting for response until timeout happens. I've decided that if there is no ad unit specified in response I should call addBidResponse for all ad units requested by the bidder. Not sure if that's the right approach but it solves the issue.
Other information
Fixes #1196