Yieldmo Bid Adapter: getBidFloor null-floor fix + defensive guards - #69
Open
ym-aaron wants to merge 1 commit into
Open
Yieldmo Bid Adapter: getBidFloor null-floor fix + defensive guards#69ym-aaron wants to merge 1 commit into
ym-aaron wants to merge 1 commit into
Conversation
…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
force-pushed
the
bugfix/yieldmo-adapter-robustness
branch
from
July 29, 2026 17:57
b657ede to
5dffd98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
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 validnullfloor rule drops the bid)Prebid's
getFloorreturnsnullwhen a matching floor rule's value is explicitlynull(priceFloors.ts:if (floorInfo.floorRuleValue === null) return null;) — a legitimate way for publishers to signal "no floor for this combination." The adapter did:That throws inside
getBidFloor, which runs duringbuildRequests(addPlacement/openRtbImpression), so the entire yieldmo request fails and we bid on nothing for that auction. Any publisher usingnullfloor rules hits this — no server misbehavior required.Fix: default the result to
{}and wrapgetFloorin try/catch (the latter also coversgetFloorthrowing on malformed floor data), then fall back toparams.bidfloor/bidFloor/0.2.
createNewVideoBid— defensive (unmatchedimpid)(…'data.imp'||[]).find(i => i.id === response.impid)returnsundefinedif a response bid'simpiddoesn't match a requested imp;imp.id/imp.video.*then throw and abortinterpretResponse, dropping every bid in that response. Nowif (!imp) return nulland 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.seatbidthrew whenserverResponse.bodywas null/missing. Now returns[]. Prebid already wrapsinterpretResponsein try/catch, so this mainly avoids a misleading "failed to interpret the server's response" error log on an empty response.Testing
gulp lint: cleangulp test --file test/spec/modules/yieldmoBidAdapter_spec.js: 72 passing (one new test per fix)Refs TDTN-8800.
🤖 Generated with Claude Code