Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

GumGum Bid Adapter: buildRequests throws 'bannerSize is not iterable' on banner + native ad units using inSlot/slot (11.7.0+)

Open coreyb-cbs opened this issue 1 month ago • 0 comments

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) with params.inSlot (L669), and the params.slot branch (L564), call getGreatestDimensions(sizes) (L393). That function does const [width, height] = bannerSize for each element, which throws TypeError: bannerSize is not iterable.
  • interpretResponse iterates bidRequest.sizes the same way for product === 3, and for product === 2 when sizes includes '1x1' (L770). So inScreen responses 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

  1. Build Prebid.js 11.7.0 or later with gumgumBidAdapter.
  2. 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 } }]
    }
    
  3. 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.js is 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 zone params or on native-only units. Banner + native with inSlot / slot is untested.
  • Suggested fix:
    • (a) Use sizes = [[1, 1]] so the shape stays consistent, and/or
    • (b) When mediaTypes.banner is 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.
  • 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 sees mediaTypes.native.
  • cc @john-ivan (author of #14737)

coreyb-cbs avatar Oct 19 '26 20:10 coreyb-cbs