Skip to content

Yieldmo Bid Adapter: getBidFloor null-floor fix + defensive guards - #69

Open
ym-aaron wants to merge 1 commit into
masterfrom
bugfix/yieldmo-adapter-robustness
Open

Yieldmo Bid Adapter: getBidFloor null-floor fix + defensive guards#69
ym-aaron wants to merge 1 commit into
masterfrom
bugfix/yieldmo-adapter-robustness

Conversation

@ym-aaron

@ym-aaron ym-aaron commented Jul 29, 2026

Copy link
Copy Markdown

Type of change

  • Bugfix

Description of change

Three fixes for the Yieldmo adapter surfaced by a full inspection during the TDTN-8800 Prebid audit. One is a real, config-driven bug; two are defensive hardening — called out honestly below.

1. getBidFloor — real bug (a valid null floor rule drops the bid)

Prebid's getFloor returns null when a matching floor rule's value is explicitly null (priceFloors.ts: if (floorInfo.floorRuleValue === null) return null;) — a legitimate way for publishers to signal "no floor for this combination." The adapter did:

floorInfo = bidRequest.getFloor({...});   // = null
return floorInfo.floor || ...;            // null.floor → TypeError

That throws inside getBidFloor, which runs during buildRequests (addPlacement / openRtbImpression), so the entire yieldmo request fails and we bid on nothing for that auction. Any publisher using null floor rules hits this — no server misbehavior required.

Fix: default the result to {} and wrap getFloor in try/catch (the latter also covers getFloor throwing on malformed floor data), then fall back to params.bidfloor/bidFloor/0.

2. createNewVideoBid — defensive (unmatched impid)

(…'data.imp'||[]).find(i => i.id === response.impid) returns undefined if a response bid's impid doesn't match a requested imp; imp.id/imp.video.* then throw and abort interpretResponse, dropping every bid in that response. Now if (!imp) return null and the caller filters the null, so only the malformed bid is skipped.

Note: verified our own exchange echoes the request imp id back (OpenRtbRequestProcessor: bidBuilder.setImpid(requestImp.getId())), so this won't fire in normal operation — it's protection against a malformed/edge response only.

3. interpretResponse — defensive (missing/null body)

data.length / data.seatbid threw when serverResponse.body was null/missing. Now returns []. Prebid already wraps interpretResponse in try/catch, so this mainly avoids a misleading "failed to interpret the server's response" error log on an empty response.

Testing

  • gulp lint: clean
  • gulp test --file test/spec/modules/yieldmoBidAdapter_spec.js: 72 passing (one new test per fix)

Refs TDTN-8800.

🤖 Generated with Claude Code

…se body)

Three defensive fixes surfaced by an adapter inspection (TDTN-8800):

1. createNewVideoBid: a response bid whose impid doesn't match a requested imp
   left `imp` undefined, so imp.id/imp.video.* threw and aborted interpretResponse,
   dropping every other bid in the response. Guard with `if (!imp) return null`
   and filter the null in interpretResponse, so only the bad bid is skipped.
2. getBidFloor: getFloor() can throw or return undefined (no matching rule);
   wrap in try/catch and default to {} so a floors misconfig can't drop the bid.
3. interpretResponse: guard a missing/null serverResponse.body (return []) instead
   of throwing on data.length / data.seatbid.

Adds a unit test for each.

Refs TDTN-8800.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ym-aaron
ym-aaron force-pushed the bugfix/yieldmo-adapter-robustness branch from b657ede to 5dffd98 Compare July 29, 2026 17:57
@ym-aaron ym-aaron changed the title Yieldmo Bid Adapter: robustness fixes (video imp guard, floor, response body) Yieldmo Bid Adapter: getBidFloor null-floor fix + defensive guards Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant