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

Add support to 0 pos value #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

george14051
Copy link

Add support to 0 pos value in bid adapter
added tests to support pos value

Copy link

@Gershon-Brainin Gershon-Brainin left a comment

Choose a reason for hiding this comment

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

Does the function _reportAuctionStatus also need changes in the verification condition of the bid position parameter?

@@ -316,7 +316,7 @@ function generateBidParameters(bid, bidderRequest) {
};

const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`);
if (pos) {
if (pos || pos === 0) {

Choose a reason for hiding this comment

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

Do we need to add the same treatment to the other adapters like kueezBidAdapter.js, minutemediaBidAdapter.js, publirBidAdapter.js, shinezBidAdapter.js, stnBidAdapter.js?

Copy link
Author

Choose a reason for hiding this comment

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

all adapters that are similar to our will need to have this treatment, not sure which of them.
@OronW @innay

Copy link

Choose a reason for hiding this comment

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

Yes. I would advise to check also kueezBidAdapter, minutemediaBidAdapter, shinezBidAdapter and stnBidAdapter.

I'm not familiar with (and couldn't find) publirBidAdapter, but if there any other adapters we own they would need to be updated as well

@@ -316,7 +316,7 @@ function generateBidParameters(bid, bidderRequest) {
};

const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`);
if (pos) {
if (pos || pos === 0) {
Copy link

Choose a reason for hiding this comment

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

Yes. I would advise to check also kueezBidAdapter, minutemediaBidAdapter, shinezBidAdapter and stnBidAdapter.

I'm not familiar with (and couldn't find) publirBidAdapter, but if there any other adapters we own they would need to be updated as well

Comment on lines 451 to 452
const mediaType = bid.mediaTypes && bid.mediaTypes.banner ? BANNER : VIDEO;
bid.mediaTypes[mediaType].pos = pos;
Copy link

Choose a reason for hiding this comment

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

Since this is done to create a new bid of your choice, and not for the production logic, there's no need for logic to test the bid's media type. You can simply add the property you want for testing, as you know the object:
bid.mediaTypes.banner.pos = pos

Copy link
Author

Choose a reason for hiding this comment

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

done

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.

3 participants