Skip to content

MobileFuse Adapter: Update to support OpenRTB MType#1

Closed
tomaszbmf wants to merge 3 commits into
masterfrom
use-mtype-for-bid-type-detection
Closed

MobileFuse Adapter: Update to support OpenRTB MType#1
tomaszbmf wants to merge 3 commits into
masterfrom
use-mtype-for-bid-type-detection

Conversation

@tomaszbmf

@tomaszbmf tomaszbmf commented Jan 14, 2026

Copy link
Copy Markdown
Owner

This PR updates the MobileFuse adapter to utilize the standard OpenRTB MType field for determining bid types, replacing the legacy ext.mf.media_type custom logic.

Key Changes:

  • Switched from parsing ext JSON to checking the native bid.MType.
  • Removed obsolete structs (ExtMf, BidExt) and logic used solely for parsing the legacy field.
  • Updated getBidType to return a BadServerResponse error if MType is missing or unsupported, rather than defaulting to Banner. Valid bids within the same response are still processed successfully.

@tomaszbmf tomaszbmf marked this pull request as draft January 14, 2026 12:52
Comment thread adapters/mobilefuse/mobilefuse.go Outdated
case openrtb2.MarkupVideo:
return openrtb_ext.BidTypeVideo
default:
return openrtb_ext.BidTypeBanner

@tomaszbmf tomaszbmf Jan 14, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtbarne do we want to still keep banner type as a fallback or resolve to error.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think either is sensible, though I'm leaning toward resolving to an error because it would probably be easier for a pub to troubleshoot if there is an issue.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtbarne I refactored to resolve to error whenmtype is missing. could check it out again?

@tomaszbmf tomaszbmf requested a review from dtbarne January 15, 2026 09:37
default:
return openrtb_ext.BidTypeBanner
return "", &errortypes.BadServerResponse{
Message: fmt.Sprintf("Unsupported MType \"%d\" for impression ID \"%s\"", bid.MType, bid.ImpID),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check how other bidders handle it? That may be best

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. In other implementations there are nuance differences (e.g. return error or fallback type, early return when any bid has error or return valid bids and additionally errors). I think that this PR is best of these worlds.

I created internal PR to mostly verify that it's fine for us to keep banner media type as a fallback (what also exists in some of other implementations) or thrown an error when mtype is missing. It's a detail however good to verify it.

@tomaszbmf tomaszbmf closed this Mar 31, 2026
@tomaszbmf

Copy link
Copy Markdown
Owner Author

close due creating official PR after internal review

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.

2 participants