GumGum Bid Adapter: buildRequests throws 'bannerSize is not iterable' on banner + native ad units using inSlot/slot (11.7.0+)
Type of issue
Bug
Description
Since 11.7.0, gumgumBidAdapter throws in buildRequests for multi-format (banner + native) ad units that use the inSlot (legacy) or slot params. Prebid core catches the exception per bidder, so the adapter's entire request for the auction is dropped. That loses every GumGum bid in the auction, including bids on banner-only units in the same auction.
Root cause: when mediaTypes.native is present, buildRequests sets sizes = [1, 1], a single size tuple. Downstream code expects an array of [w, h] tuples (gumgumBidAdapter.js#L530-L535):
if (mediaTypes.native) {
sizes = [1, 1]; // flat tuple
} else if (mediaTypes.banner) {
sizes = mediaTypes.banner.sizes;
}
handleLegacyParams(params, sizes)withparams.inSlot(L669), and theparams.slotbranch (L564), callgetGreatestDimensions(sizes)(L393). That function doesconst [width, height] = bannerSizefor each element, which throwsTypeError: bannerSize is not iterable.interpretResponseiteratesbidRequest.sizesthe same way forproduct === 3, and forproduct === 2whensizesincludes'1x1'(L770). SoinScreenresponses on these units likely fail as well.
Before 11.7.0, the adapter did not declare NATIVE and only checked mediaTypes.banner / mediaTypes.video, so banner sizes were used and these units worked.
There is also a separate problem: preferring native over banner whenever both are present changes behavior for existing multi-format units configured for in-slot display. The repo's review guidelines warn against this: bidders "should not change the default preferred ad format suddenly, eg by adding support for video or native and suddenly preferring it."
Steps to reproduce
- Build Prebid.js 11.7.0 or later with
gumgumBidAdapter. - Configure this ad unit:
{ code: 'div-1', mediaTypes: { banner: { sizes: [[300, 250], [300, 600]] }, native: { title: { required: true }, image: { required: true } } }, bids: [{ bidder: 'gumgum', params: { inSlot: 12345 } }] } - Call
pbjs.requestBids(...).
Test page
Not available. The ad unit above reproduces the problem, and calling getGreatestDimensions([1, 1]) directly also throws.
Expected results
A GumGum in-slot request with banner sizes, as in 11.6.0 and earlier: pi=3, bf=300x250,300x600, maxw=300, maxh=600.
Actual results
No GumGum request is sent. The console logs gumgum Bid Adapter emitted an uncaught error when parsing their bidRequest with TypeError: bannerSize is not iterable.
Platform details
- Prebid.js 11.7.0 – 11.41.0 (
gumgumBidAdapter.jsis unchanged across 11.39.0 – 11.41.0) - Any browser
Other information
- Introduced by #14683 / #14737 and shipped in 11.7.0. Still unfixed in 11.41.0.
- The automated Codex review flagged this on both PRs, and neither comment received a response:
- #14683 (P2): "Preserve banner sizes for slot requests in multi-format bids"
- #14737 (P1): "Store native fallback size as a size tuple". That review was on commit
e17a084c0, the same commit that was approved and merged.
- The existing tests cover native only with
zoneparams or on native-only units. Banner + native withinSlot/slotis untested. - Suggested fix:
- (a) Use
sizes = [[1, 1]]so the shape stays consistent, and/or - (b) When
mediaTypes.banneris also present, keep the banner sizes, or only switch to native when no in-slot/display params are used, so existing multi-format units don't change format.
- (a) Use
- For comparison,
taboolaBidAdapter, which also supports banner + native, sends multi-format units to both its banner and native endpoints via the shared ortbConverter rather than preferring one format (buildRequests,getMediaType). - Workaround for publishers: on multi-format units, give the GumGum bid its own
adUnit.bids[].mediaTypes = { banner: { sizes: [...] } }so the adapter never seesmediaTypes.native. - cc @john-ivan (author of #14737)