-
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
Fixing some recent bugs in addBidResponse #1372
Conversation
… which adapters are doing this.
…e bid properties.
@@ -108,11 +108,11 @@ exports.addBidResponse = function (adUnitCode, bid) { | |||
} | |||
|
|||
if (!adUnitCode) { | |||
utils.logWarn(errorMessage('No adUnitCode was supplied to addBidResponse.')); |
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.
fwiw if you put the bid check before the adUnitCode, you could still use errorMessage here
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.
true, these checks really shouldn't be necessary anyway once we have a proper adapter validator in place.
* Added back the guard against undefined bids... for now. * Added back the guard to allow undefined bids, because we have no idea which adapters are doing this. * Made sure that the bid adjustment event fired before we use any of the bid properties.
* Added back the guard against undefined bids... for now. * Added back the guard to allow undefined bids, because we have no idea which adapters are doing this. * Made sure that the bid adjustment event fired before we use any of the bid properties.
Type of change
Bugfix
Description of change
Fixing some regressions introduced in #1277
The old code allowed adapters to call
addBidResponse
without supplying a bid. This permissibility may or may not be a good idea... but Implementing prebid-cache to support Video ads #1277 definitely isn't a good place to make that change. The(!bid)
check is added back in here.The
bidAdustment
event needs to be fired before thegetPriceBucketStrings
gets called, because listeners for that event may mutate the bid's cpm.