-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only set mediaTypes.banner.sizes from sizes if mediaTypes doesn't exist. #3274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -65,22 +65,20 @@ export function resolveStatus({labels = [], labelAll = false, activeLabels = []} | |||
let maps = evaluateSizeConfig(configs); | |||
|
|||
if (!isPlainObject(mediaTypes)) { | |||
mediaTypes = {}; | |||
// add support for deprecated adUnit.sizes by creating correct banner mediaTypes if they don't already exist | |||
if (sizes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this check if mediaTypes already exists, as stated in description?
I'm testing this fix out, but I still see mediaTypes.banner.sizes set when I'm only configuring an instream video mediaType.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I was testing a prebid version without this fix. With the fix, I can confirm that it is working as expected and no longer setting mediaType.banner if only a video unit.
Thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of change
Description of change
Fixes #3269. The issue is when
mediaTypes.video.playerSize
is set thenadUnits.sizes
is set here. Since sizeMapping still supportsadUnit.sizes
it will setadUnit.mediaTypes.banner.sizes
if it doesn't already exist, which is a bug ifadUnit.sizes
was set from the video sizes. So to fix this, this pull-request only setsadUnit.mediaTypes.banner.sizes
fromadUnit.sizes
ifadUnit.mediaTypes
doesn't exist.