From 37ab555c840803dde2ef4971ee53955afbdecea6 Mon Sep 17 00:00:00 2001 From: mkomorski Date: Fri, 10 May 2024 14:32:51 +0200 Subject: [PATCH] 9789 tmax/timeout set to value from bidderRequest (#11469) Co-authored-by: mkomorski Co-authored-by: Demetrio Girardi --- modules/advangelistsBidAdapter.js | 4 ++-- modules/axonixBidAdapter.js | 2 +- modules/bluebillywigBidAdapter.js | 2 +- modules/brightMountainMediaBidAdapter.js | 2 +- modules/lkqdBidAdapter.js | 2 +- modules/mgidXBidAdapter.js | 2 +- modules/oguryBidAdapter.js | 2 +- modules/rhythmoneBidAdapter.js | 2 +- modules/visxBidAdapter.js | 3 +-- test/spec/modules/advangelistsBidAdapter_spec.js | 6 +++--- test/spec/modules/bluebillywigBidAdapter_spec.js | 2 +- test/spec/modules/lkqdBidAdapter_spec.js | 2 +- test/spec/modules/mgidXBidAdapter_spec.js | 3 ++- test/spec/modules/oguryBidAdapter_spec.js | 1 + 14 files changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/advangelistsBidAdapter.js b/modules/advangelistsBidAdapter.js index 8e5be83f166..a916e07a963 100755 --- a/modules/advangelistsBidAdapter.js +++ b/modules/advangelistsBidAdapter.js @@ -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': [], @@ -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': [], diff --git a/modules/axonixBidAdapter.js b/modules/axonixBidAdapter.js index 87c3aff444a..b1ccef155de 100644 --- a/modules/axonixBidAdapter.js +++ b/modules/axonixBidAdapter.js @@ -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, }; diff --git a/modules/bluebillywigBidAdapter.js b/modules/bluebillywigBidAdapter.js index d4bde9b3f2c..0718f512cdd 100644 --- a/modules/bluebillywigBidAdapter.js +++ b/modules/bluebillywigBidAdapter.js @@ -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: { diff --git a/modules/brightMountainMediaBidAdapter.js b/modules/brightMountainMediaBidAdapter.js index 6db06744c24..98b97286631 100644 --- a/modules/brightMountainMediaBidAdapter.js +++ b/modules/brightMountainMediaBidAdapter.js @@ -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: {}, diff --git a/modules/lkqdBidAdapter.js b/modules/lkqdBidAdapter.js index 1dbe89f5a49..d4b1cdea0d1 100644 --- a/modules/lkqdBidAdapter.js +++ b/modules/lkqdBidAdapter.js @@ -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: { diff --git a/modules/mgidXBidAdapter.js b/modules/mgidXBidAdapter.js index ac25a419de1..f073fb4c576 100644 --- a/modules/mgidXBidAdapter.js +++ b/modules/mgidXBidAdapter.js @@ -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) { diff --git a/modules/oguryBidAdapter.js b/modules/oguryBidAdapter.js index 9937391f6e7..3cf78da4e3a 100644 --- a/modules/oguryBidAdapter.js +++ b/modules/oguryBidAdapter.js @@ -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: { diff --git a/modules/rhythmoneBidAdapter.js b/modules/rhythmoneBidAdapter.js index 749ab92c0dc..3ab8b79df81 100644 --- a/modules/rhythmoneBidAdapter.js +++ b/modules/rhythmoneBidAdapter.js @@ -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 diff --git a/modules/visxBidAdapter.js b/modules/visxBidAdapter.js index a86c958392e..beffcf5da95 100644 --- a/modules/visxBidAdapter.js +++ b/modules/visxBidAdapter.js @@ -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', diff --git a/test/spec/modules/advangelistsBidAdapter_spec.js b/test/spec/modules/advangelistsBidAdapter_spec.js index 143d85a1ab6..57ad2d0e898 100755 --- a/test/spec/modules/advangelistsBidAdapter_spec.js +++ b/test/spec/modules/advangelistsBidAdapter_spec.js @@ -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; }); }); diff --git a/test/spec/modules/bluebillywigBidAdapter_spec.js b/test/spec/modules/bluebillywigBidAdapter_spec.js index 4b58e3507db..b6fb11c4750 100644 --- a/test/spec/modules/bluebillywigBidAdapter_spec.js +++ b/test/spec/modules/bluebillywigBidAdapter_spec.js @@ -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'); diff --git a/test/spec/modules/lkqdBidAdapter_spec.js b/test/spec/modules/lkqdBidAdapter_spec.js index 7fee9bf6e41..4ff69ce5e2a 100644 --- a/test/spec/modules/lkqdBidAdapter_spec.js +++ b/test/spec/modules/lkqdBidAdapter_spec.js @@ -140,7 +140,7 @@ describe('lkqdBidAdapter', () => { }); it('should not populate unspecified parameters', () => { - const requests = spec.buildRequests(bidRequests); + const requests = spec.buildRequests(bidRequests, { timeout: 1000 }); const serverRequestObject = requests[0]; expect(serverRequestObject.data.device.dnt).to.be.a('undefined'); diff --git a/test/spec/modules/mgidXBidAdapter_spec.js b/test/spec/modules/mgidXBidAdapter_spec.js index e0b1e1a84e9..9efaf94c954 100644 --- a/test/spec/modules/mgidXBidAdapter_spec.js +++ b/test/spec/modules/mgidXBidAdapter_spec.js @@ -83,7 +83,8 @@ describe('MGIDXBidAdapter', function () { }, refererInfo: { referer: 'https://test.com' - } + }, + timeout: 1000 }; describe('isBidRequestValid', function () { diff --git a/test/spec/modules/oguryBidAdapter_spec.js b/test/spec/modules/oguryBidAdapter_spec.js index aad753571a8..ea923a18e57 100644 --- a/test/spec/modules/oguryBidAdapter_spec.js +++ b/test/spec/modules/oguryBidAdapter_spec.js @@ -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 () {