Skip to content
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

Advanced Size Mapping Module bug empties config on refresh #5458

Closed
benjaminclot opened this issue Jul 6, 2020 · 1 comment · Fixed by #5487
Closed

Advanced Size Mapping Module bug empties config on refresh #5458

benjaminclot opened this issue Jul 6, 2020 · 1 comment · Fixed by #5487
Assignees
Labels

Comments

@benjaminclot
Copy link
Contributor

benjaminclot commented Jul 6, 2020

Type of issue

When a config has an empty sizeConfig.sizes property set, [] becomes [[]] so on the next refresh, this adunit's sizeConfig becomes invalid and it gets "deleted". I have been able to trace the problem back to this test: https://github.com/prebid/Prebid.js/blob/master/modules/sizeMappingV2.js#L109

Test page

https://jsfiddle.net/Lmw0zrp5/
Have the window below 768px and hit refresh, pbjs.adUnits[0] will have its bids and mediaTypes properties empty.

Expected results

The pbjs.adUnits object should remain untouched or maybe the test should use utils.isEmpty()?

@Fawke Fawke self-assigned this Jul 9, 2020
@Fawke Fawke added the bug label Jul 9, 2020
@Fawke
Copy link
Contributor

Fawke commented Jul 9, 2020

Hi @benjaminclot,

Yeah, I see can that I'm getting an error on clicking "REFRESH" on your test page. Thanks for bringing this up, I think I've come up with a fix, and am working on some other optimizations, will raise a PR for this fix shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants