From 1965f4dbbce61146364d3ae34ba77e16abd7f1be Mon Sep 17 00:00:00 2001 From: Demetrio Girardi Date: Tue, 10 Sep 2024 06:50:27 -0700 Subject: [PATCH] PAAPI: fix bug where auctions break if adunits have only placeholder sizes --- modules/paapi.js | 4 +++- test/spec/modules/paapi_spec.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/paapi.js b/modules/paapi.js index 9ae2c870e5d..02fb38624f8 100644 --- a/modules/paapi.js +++ b/modules/paapi.js @@ -314,9 +314,11 @@ function getFledgeConfig(bidder) { * Given an array of size tuples, return the one that should be used for PAAPI. */ export const getPAAPISize = hook('sync', function (sizes) { + sizes = sizes + ?.filter(([w, h]) => !(w === h && w <= 5)); + if (sizes?.length) { return sizes - .filter(([w, h]) => !(w === h && w <= 5)) .reduce(maximum(keyCompare(([w, h]) => w * h))); } }, 'getPAAPISize'); diff --git a/test/spec/modules/paapi_spec.js b/test/spec/modules/paapi_spec.js index cc839307c8e..0f719a9d058 100644 --- a/test/spec/modules/paapi_spec.js +++ b/test/spec/modules/paapi_spec.js @@ -1122,6 +1122,10 @@ describe('paapi module', () => { 'can handle no input': { in: undefined, out: undefined + }, + 'can handle placeholder sizes': { + in: [[1, 1]], + out: undefined } }).forEach(([t, {in: input, out}]) => { it(t, () => {