Skip to content
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

PBS Bid Adapter: Stop overriding s2sconfig.enabled from vendor defaults #6622

Merged
merged 17 commits into from
Apr 22, 2021
Merged
2 changes: 1 addition & 1 deletion modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ config.setDefaults({
* @return {boolean}
*/
function updateConfigDefaultVendor(option) {
if (option.defaultVendor) {
if (option.defaultVendor && option.enabled !== false) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If s2sConfig does not explicitly state enabled === true then it always defaults to false (even though defaultVendor json option has it to true).
It is being overwritten before this line by the defaultS2sConfig here: https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#L75

I should have caught this during my PR review, sorry @patmmccann

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are saying if someone selects defaultVendor and sets enabled = false the override is still occuring? I thought

option[vendorKey] = S2S_VENDORS[vendor][vendorKey];
was the line that did the overwrite and this change would prevent that from executing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the opposite actually.

Now it is ignoring that defaultVendor.enabled flag.

So if you have this:

{
   defaultVendor: 'rubicon',
   bidders: ['rubicon']
}

It will have enabled: false

So you have to explicitly do:

{
   enabled: true,
   defaultVendor: 'rubicon',
   bidders: ['rubicon']
}

I have not pinpointed exact spot yet since I am busy on something else, but I should be able to add a PR to address later this week.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I suppose deleting

Would have other negative effects

let vendor = option.defaultVendor;
let optionKeys = Object.keys(option);
if (S2S_VENDORS[vendor]) {
Expand Down