Skip to content

Commit

Permalink
revert PR #9050
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrmartinez committed Aug 8, 2023
1 parent 49418b1 commit 9b51d9a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DEFAULT_PBS_INTEGRATION = 'pbjs';
const DEFAULT_RENDERER_URL = 'https://video-outstream.rubiconproject.com/apex-2.2.1.js';
// renderer code at https://github.com/rubicon-project/apex2

let rubiConf = {};
let rubiConf = config.getConfig('rubicon') || {};
// we are saving these as global to this module so that if a pub accidentally overwrites the entire
// rubicon object, then we do not lose other data
config.getConfig('rubicon', config => {
Expand Down Expand Up @@ -322,6 +322,7 @@ export const spec = {
)
);
});
// if (rubiConf.singleRequest !== true) {
if (config.getConfig('rubicon.singleRequest') !== true) {
// bids are not grouped if single request mode is not enabled
requests = filteredHttpRequest.concat(bannerBidRequests.map(bidRequest => {
Expand Down
24 changes: 24 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,30 @@ describe('the rubicon adapter', function () {
});
});

it('should still use single request if other rubicon configs are set after', function () {
// set single request to true
config.setConfig({ rubicon: { singleRequest: true } });

// execute some other rubicon setConfig
config.setConfig({ rubicon: { netRevenue: true } });

const bidCopy = utils.deepClone(bidderRequest.bids[0]);
bidderRequest.bids.push(bidCopy);
bidderRequest.bids.push(bidCopy);
bidderRequest.bids.push(bidCopy);

let serverRequests = spec.buildRequests(bidderRequest.bids, bidderRequest);

// should have 1 request only
expect(serverRequests).that.is.an('array').of.length(1);

// get the built query
let data = parseQuery(serverRequests[0].data);

// num slots should be 4
expect(data.slots).to.equal('4');
});

it('should not group bid requests if singleRequest does not equal true', function () {
config.setConfig({rubicon: {singleRequest: false}});

Expand Down

0 comments on commit 9b51d9a

Please sign in to comment.