Skip to content

Commit 2aadc09

Browse files
authored
AdagioBidAdapter: fix floor price module support (prebid#10711)
1 parent fe5fbb7 commit 2aadc09

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

modules/adagioBidAdapter.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {find} from '../src/polyfill.js';
22
import {
3-
_map,
43
cleanObj,
54
deepAccess,
65
deepClone,
@@ -570,6 +569,7 @@ function _parseNativeBidResponse(bid) {
570569
bid.native = native
571570
}
572571

572+
// bidRequest param must be the `bidRequest` object with the original `auctionId` value.
573573
function _getFloors(bidRequest) {
574574
if (!isFn(bidRequest.getFloor)) {
575575
return false;
@@ -996,7 +996,7 @@ export const spec = {
996996

997997
const aucId = generateUUID()
998998

999-
const adUnits = _map(validBidRequests, (rawBidRequest) => {
999+
const adUnits = validBidRequests.map(rawBidRequest => {
10001000
const bidRequest = deepClone(rawBidRequest);
10011001

10021002
// Fix https://github.com/prebid/Prebid.js/issues/9781
@@ -1068,7 +1068,10 @@ export const spec = {
10681068
});
10691069

10701070
// Handle priceFloors module
1071-
const computedFloors = _getFloors(bidRequest);
1071+
// We need to use `rawBidRequest` as param because:
1072+
// - adagioBidAdapter generates its own auctionId due to transmitTid activity limitation (see https://github.com/prebid/Prebid.js/pull/10079)
1073+
// - the priceFloors.getFloor() uses a `_floorDataForAuction` map to store the floors based on the auctionId.
1074+
const computedFloors = _getFloors(rawBidRequest);
10721075
if (isArray(computedFloors) && computedFloors.length) {
10731076
bidRequest.floors = computedFloors
10741077

@@ -1149,7 +1152,7 @@ export const spec = {
11491152
});
11501153

11511154
// Build one request per organizationId
1152-
const requests = _map(Object.keys(groupedAdUnits), organizationId => {
1155+
const requests = Object.keys(groupedAdUnits).map(organizationId => {
11531156
return {
11541157
method: 'POST',
11551158
url: ENDPOINT,

0 commit comments

Comments
 (0)