mediafuseBidAdapter - Updates, Refactor and Fixes.#14537
mediafuseBidAdapter - Updates, Refactor and Fixes.#14537ibhattacharya-dev wants to merge 3 commits intoprebid:masterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a2d492b76
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const extANData = { | ||
| prebid: true, | ||
| hb_source: 1, // 1 = client/web-originated header bidding request (Xandr source enum) |
There was a problem hiding this comment.
Preserve adpod source flag in appnexus request ext
The adapter now hard-codes ext.appnexus.hb_source to 1, so ad pod bids (mediaTypes.video.context === 'adpod') are no longer marked with the adpod source value (7) used previously. In production this makes adpod traffic look like standard instream traffic to Xandr, which can break pod-specific auction behavior (including pod routing/category controls) for publishers already using adpod.
Useful? React with 👍 / 👎.
| delete tag.ad_types; | ||
| } | ||
| chunkedRequests.forEach(batch => { | ||
| const data = converter.toORTB({ bidRequests: batch, bidderRequest }); |
There was a problem hiding this comment.
Restore adpod placement expansion before ORTB conversion
This path converts each incoming bid request directly to ORTB without any adpod-specific expansion, but the previous implementation duplicated adpod placements using adPodDurationSec/durationRangeSec before chunking. For mediaTypes.video.context === 'adpod', this regresses pod fill because only one imp is requested instead of the expected number of pod opportunities.
Useful? React with 👍 / 👎.
| extANData.video_frameworks = videoParams.frameworks; | ||
| } | ||
| } else { | ||
| imp.video[param] = videoParams[param]; |
There was a problem hiding this comment.
Map string playback_method values to numeric enum
The refactor now copies params.video.playback_method straight into imp.video without normalizing legacy string values (e.g. auto_play_sound_off) to Xandr’s numeric enum. Existing publisher configs that still send the string form will emit an invalid type in the outbound request and can lose intended playback targeting.
Useful? React with 👍 / 👎.
| function hasOmidSupport(bid) { | ||
| let hasOmid = false; | ||
| const bidderParams = bid?.params; | ||
| const videoParams = bid?.mediaTypes?.video?.api; |
There was a problem hiding this comment.
Keep OMID detection for params.video.frameworks
OMID support is now inferred from mediaTypes.video.api (plus top-level params.frameworks), but this drops the legacy params.video.frameworks check that the old adapter used. Bids that still signal OMID via params.video.frameworks: [6] will miss ext.appnexus.iab_support, which can prevent OMID-capable inventory/creative negotiation in those integrations.
Useful? React with 👍 / 👎.
Pull Request Test Coverage Report for Build 22587861530Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71e6d9521a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (FEATURES.VIDEO && mediaType === VIDEO) { | ||
| bidResponse.ttl = 3600; | ||
| if (bid.nurl) { | ||
| bidResponse.vastImpUrl = bid.nurl; | ||
| } |
There was a problem hiding this comment.
Restore adpod response metadata for duration/category targeting
The new video response path returns only generic video fields and no longer builds adpod-specific metadata (video.context, video.durationSeconds, video.dealTier, meta.primaryCatId). For mediaTypes.video.context === 'adpod', the adpod hooks in modules/adpod.js depend on these fields to validate/bucket bids and generate hb_pb_cat_dur; without them, adpod bids can be rejected or produce invalid targeting keys even when the auction otherwise succeeds.
Useful? React with 👍 / 👎.
| if (appObjBid) { | ||
| request.app = Object.assign({}, request.app, appObjBid.params.app); |
There was a problem hiding this comment.
Move legacy app.device_id into ORTB device object
This compatibility branch now copies params.app directly onto request.app but does not map legacy params.app.device_id into request.device. Existing mobile/webview integrations that still provide identifiers through params.app.device_id will lose device IDs in the ORTB device payload after this refactor, reducing identity match and bidder targeting quality.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aad02fe737
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| const request = formatRequest(payload, bidderRequest); | ||
| return request; |
There was a problem hiding this comment.
Restore adpod brand-category uniqueness request flag
When pbjs.setConfig({adpod: {brandCategoryExclusion: true}}) is enabled, the previous adapter set brand_category_uniqueness on outbound requests, but this refactor returns the request without adding any equivalent flag. In adpod traffic this can change auction behavior by allowing same-category creatives within a pod, which breaks existing brand-category-exclusion expectations for publishers using this config.
Useful? React with 👍 / 👎.
| extANData.video_frameworks = videoParams.frameworks; | ||
| } | ||
| } else { | ||
| imp.video[param] = videoParams[param]; |
There was a problem hiding this comment.
Normalize legacy video context values before assigning
This branch copies params.video.context straight into imp.video.context, but legacy Mediafuse/AppNexus configs commonly provide string values such as pre_roll, mid_roll, and post_roll that previously were mapped to Xandr numeric enums. Sending the raw string drops that mapping and can silently lose intended video-context targeting for existing integrations.
Useful? React with 👍 / 👎.
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
Refactored the mediafuseBidAdapter to follow the standard ortbConverter module.
Structure now follows MSFT Bid Adapter due to pending replacement of AppNexus Bid Adapter by the newer Microsoft Bid Adapter for better maintainability.
Fixed Test issues flagged in last Pull Request.
Other information