Skip to content

FS-12403: add bcat/badv support for banner + fix video merge#65

Open
ym-aaron wants to merge 4 commits into
masterfrom
FS-12403-bcat-badv
Open

FS-12403: add bcat/badv support for banner + fix video merge#65
ym-aaron wants to merge 4 commits into
masterfrom
FS-12403-bcat-badv

Conversation

@ym-aaron

@ym-aaron ym-aaron commented Jun 3, 2026

Copy link
Copy Markdown

What

Adds bcat / badv support to the banner (non-video) path and fixes the video path's blocklist handling in the Yieldmo adapter. Resolves FS-12403.

Why

Per FS-12403 (and Abhineet's comments), the adapter had several blocklist gaps:

  • bcat read the wrong pathdeepAccess(bidderRequest, 'bcat') is always undefined; the value lives at ortb2.bcat. The ORTB source was effectively dead.
  • badv had no ortb2 support — only params.badv was read.
  • No merge|| meant a publisher setting both ortb2 and params silently lost one.
  • Banner sent neither — the non-video request never included bcat/badv.
  • Undocumented — neither param was in yieldmoBidAdapter.md.

The ad-server side already accepts these on the prebid-js endpoint (AS-5349), so the wire format is fixed: comma-delimited params on the banner GET.

Changes

  • mergeBlocklist() helper — unions ortb2.<field> + params.<field>, de-dupes (Set), and filters non-array sources / non-string / empty entries with a logWarn instead of dropping the bid (mirrors the in-tree pubmaticBidAdapter norm).
  • Banner path — sends bcat/badv as comma-delimited GET params; omitted when empty; intentionally kept out of BANNER_REQUEST_PROPERTIES_TO_REDUCE so URL-length trimming can never corrupt a blocklist.
  • Video path — now reads ortb2.bcat/ortb2.badv and merges with params.* (OpenRTB arrays, unchanged shape).
  • validateVideoParams — removed the bcat/badv array checks (they were video-only and dropped the bid); normalization now lives in mergeBlocklist, so malformed values no longer drop a bid.

Behavior change

  • Missing bcat/badv is allowed — unchanged.
  • A malformed value (present but not an array) now drops the bid via isBidRequestValid, for both banner and video (previously this reject only ran for video). Keeps brand-safety strict on bad input without penalizing absence.
  • Invalid elements inside an otherwise-valid array, and a malformed ortb2 value (which isn't bid-validated), are filtered out with a logWarn rather than failing the bid.

See the decision trail on FS-12403.

Tests

13 new spec cases (banner comma format, union, dedupe+order, ortb2-only, params-only, omit-when-empty; video arrays, correct ortb2.bcat path, empty defaults; malformed filter+warn, trim, bid-not-dropped). Full yieldmoBidAdapter_spec.js suite passes (82 tests).

Prior art

Surveyed every adapter that handles bcat/badv. On rejecting malformed input, outbrainBidAdapter drops the bid (requires an array of strings); most others ignore/filter (discovery: Array.isArray(x) ? x : []; pubmatic filters elements with a logWarn; taboola/vidoomy/etc. pass through). This PR lands in the middle: strict like outbrain on a malformed param (drop the bid), but lenient on element-level issues and ortb2 (filter + logWarn), and it never penalizes a missing value.

🤖 Generated with Claude Code

- Add mergeBlocklist() helper: union ortb2.<field> + params.<field>, dedupe,
  filter invalid/non-string entries with logWarn, never drop the bid.
- Banner (non-video) path now sends bcat/badv as comma-delimited params
  (per the AS-5349 ad-server endpoint); omitted when empty; never subject to
  URL-length trimming.
- Video path reads ortb2.bcat/ortb2.badv (was the dead bidderRequest.bcat path)
  and merges with params instead of || precedence.
- Remove bcat/badv checks from validateVideoParams (now normalized in
  mergeBlocklist; no longer bid-dropping, applies to all media types).
- Add unit tests and yieldmoBidAdapter.md docs for both params.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ym-aaron ym-aaron force-pushed the FS-12403-bcat-badv branch from 95f25a8 to cf627a1 Compare June 3, 2026 18:05
ym-aaron and others added 3 commits June 3, 2026 13:29
Per review discussion (Aaron + Niko): keep brand-safety strict for malformed
input while not penalizing absence.

- Add validateBlocklistParams(), run for ALL bids (banner + video) via
  isBidRequestValid: a missing bcat/badv passes; a value that is present but
  not an array fails validation (drops the bid).
- mergeBlocklist still merges + dedupes, and defensively filters the ortb2
  source (not bid-validated) and non-string/empty array elements, with logWarn.
- Update spec (missing-allowed / malformed-dropped cases) and the .md docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move isDefined / paramRequired / paramInvalid and the field validator out of
validateVideoParams to module scope (createParamValidator binds them to a bid),
so validateVideoParams and validateBlocklistParams share one validation style.
validateBlocklistParams now uses the same validate(...) + try/catch pattern
instead of its own bespoke check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename mergeBlocklist -> getBlocklist and have it take (bidderRequest, bid, field),
doing the ortb2.<field> / params.<field> deepAccess lookups itself. Call sites no
longer repeat deepAccess or the path strings; the field name appears once per call.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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