-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ad unit parse fix #36
Ad unit parse fix #36
Conversation
…Wrap/Prebid.js into latency-issue-hack
…d impression and changing values for those only for which the bid is received
modules/pubmaticBidAdapter.js
Outdated
return; | ||
slot = splits[0]; | ||
if (splits.length == 2) { | ||
bid.params.adUnitIndex = splits[1].split(":")[1]; |
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.
Will break in case the split on colon doesn't produce two elements. I believe this is not a mandatory check.
if (splits.length != 2) { | ||
utils.logWarn('AdSlot Error: adSlot not in required format'); | ||
return; | ||
slot = splits[0]; |
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.
why are we initializing this variable?
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.
It's already initialized on line no 75 and value has been assigned for ad slot on line no 82
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.
Ok
modules/pubmaticBidAdapter.js
Outdated
} | ||
splits = splits[1].split(":")[0].split("x"); | ||
if (splits.length != 2) { | ||
utils.logWarn('AdSlot Error: adSlot not in required format'); |
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.
Not specific to this changes but all messages should be of format:
utils.logWarn(BIDDER_CODE : Message)
Also it would be good to print the format here i.e
<adunit>@<width>x<height>
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.
Please ensure we add Unit test cases for this particular format of adunits as well
modules/pubmaticBidAdapter.js
Outdated
return; | ||
slot = splits[0]; | ||
if (splits.length == 2) { | ||
bid.params.adUnitIndex = splits[1].split(":")[1]; |
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.
This line sets adUnitIndex to undefined in case of bid = {params:{adSlot: 'abcd@10x80'}};
Default value for adUnitIndex is '0'
|
||
slot = splits[0]; | ||
if (splits.length == 2) { | ||
bid.params.adUnitIndex = splits[1]; |
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.
Complete unit test cases before QA drop.
Looks good. |
* sends refererInfo to kraken * minor change * removes comment
Colon parsing issue. Changed the sequence of spiting and parsing.