Skip to content

Commit

Permalink
9789 tmax/timeout set to value from bidderRequest (#11469)
Browse files Browse the repository at this point in the history
Co-authored-by: mkomorski <marcin.komorski@gmail.com>
Co-authored-by: Demetrio Girardi <dgirardi@prebid.org>
  • Loading branch information
3 people authored May 10, 2024
1 parent ef42add commit 37ab555
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions modules/advangelistsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function createVideoRequestData(bid, bidderRequest) {
},
'at': 2,
'site': {},
'tmax': 3000,
'tmax': Math.min(3000, bidderRequest.timeout),
'cur': ['USD'],
'id': bid.bidId,
'imp': [],
Expand Down Expand Up @@ -322,7 +322,7 @@ function createBannerRequestData(bid, bidderRequest) {
},
'at': 2,
'site': {},
'tmax': 3000,
'tmax': Math.min(3000, bidderRequest.timeout),
'cur': ['USD'],
'id': bid.bidId,
'imp': [],
Expand Down
2 changes: 1 addition & 1 deletion modules/axonixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const spec = {
prebidVersion: '$prebid.version$',
screenHeight: screen.height,
screenWidth: screen.width,
tmax: config.getConfig('bidderTimeout'),
tmax: bidderRequest.timeout,
ua: navigator.userAgent,
};

Expand Down
2 changes: 1 addition & 1 deletion modules/bluebillywigBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export const spec = {
const request = {
id: bidderRequest.bidderRequestId,
source: {tid: bidderRequest.ortb2?.source?.tid},
tmax: BB_CONSTANTS.DEFAULT_TIMEOUT,
tmax: Math.min(BB_CONSTANTS.DEFAULT_TIMEOUT, bidderRequest.timeout),
imp: imps,
test: DEV_MODE ? 1 : 0,
ext: {
Expand Down
2 changes: 1 addition & 1 deletion modules/brightMountainMediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const spec = {
site: buildSite(bidderRequest),
device: buildDevice(),
cur: [CURRENCY],
tmax: 1000,
tmax: Math.min(1000, bidderRequest.timeout),
regs: buildRegs(bidderRequest),
user: {},
source: {},
Expand Down
2 changes: 1 addition & 1 deletion modules/lkqdBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const spec = {
},
test: 0,
at: 2,
tmax: bid.params.timeout || config.getConfig('bidderTimeout') || 100,
tmax: bidderRequest.timeout,
cur: ['USD'],
regs: {
ext: {
Expand Down
2 changes: 1 addition & 1 deletion modules/mgidXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const spec = {
placements,
coppa: config.getConfig('coppa') === true ? 1 : 0,
ccpa: bidderRequest.uspConsent || undefined,
tmax: config.getConfig('bidderTimeout')
tmax: bidderRequest.timeout
};

if (bidderRequest.gdprConsent) {
Expand Down
2 changes: 1 addition & 1 deletion modules/oguryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) {
function buildRequests(validBidRequests, bidderRequest) {
const openRtbBidRequestBanner = {
id: bidderRequest.bidderRequestId,
tmax: DEFAULT_TIMEOUT,
tmax: Math.min(DEFAULT_TIMEOUT, bidderRequest.timeout),
at: 1,
regs: {
ext: {
Expand Down
2 changes: 1 addition & 1 deletion modules/rhythmoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function RhythmOneBidAdapter() {
}
},
at: 1,
tmax: 1000,
tmax: Math.min(1000, bidderRequest.timeout),
regs: {
ext: {
gdpr: deepAccess(bidderRequest, 'gdprConsent.gdprApplies') ? Boolean(bidderRequest.gdprConsent.gdprApplies & 1) : false
Expand Down
3 changes: 1 addition & 2 deletions modules/visxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ export const spec = {
}
}

const bidderTimeout = Number(config.getConfig('bidderTimeout')) || timeout;
const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout;
const tmax = timeout;
const source = {
ext: {
wrapperType: 'Prebid_js',
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/advangelistsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ describe('advangelistsBidAdapter', function () {
describe('spec.buildRequests', function () {
it('should create a POST request for each bid', function () {
const bidRequest = bidRequests[0];
const requests = spec.buildRequests([ bidRequest ]);
const requests = spec.buildRequests([ bidRequest ], { timeout: 1000 });
expect(requests[0].method).to.equal('POST');
});

it('should create a POST request for each bid in video request', function () {
const bidRequest = bidRequestsVid[0];
const requests = spec.buildRequests([ bidRequest ]);
const requests = spec.buildRequests([ bidRequest ], { timeout: 1000 });
expect(requests[0].method).to.equal('POST');
});

it('should have domain in request', function () {
const bidRequest = bidRequests[0];
const requests = spec.buildRequests([ bidRequest ]);
const requests = spec.buildRequests([ bidRequest ], { timeout: 1000 });
expect(requests[0].data.site.domain).length !== 0;
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/bluebillywigBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe('BlueBillywigAdapter', () => {
expect(payload.id).to.exist;
expect(payload.source).to.be.an('object');
expect(payload.source.tid).to.equal(validBidderRequest.ortb2.source.tid);
expect(payload.tmax).to.equal(BB_CONSTANTS.DEFAULT_TIMEOUT);
expect(payload.tmax).to.equal(3000);
expect(payload.imp).to.be.an('array');
expect(payload.test).to.be.a('number');
expect(payload).to.have.nested.property('ext.prebid.targeting');
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/lkqdBidAdapter_spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion test/spec/modules/mgidXBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ describe('MGIDXBidAdapter', function () {
},
refererInfo: {
referer: 'https://test.com'
}
},
timeout: 1000
};

describe('isBidRequestValid', function () {
Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/oguryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('OguryBidAdapter', function () {
bidderRequestId: 'mock-uuid',
auctionId: bidRequests[0].auctionId,
gdprConsent: {consentString: 'myConsentString', vendorData: {}, gdprApplies: true},
timeout: 1000
};

describe('isBidRequestValid', function () {
Expand Down

0 comments on commit 37ab555

Please sign in to comment.