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

pbjs.getAllWinningBids() not working correctly #2238

Closed
snapwich opened this issue Mar 7, 2018 · 8 comments
Closed

pbjs.getAllWinningBids() not working correctly #2238

snapwich opened this issue Mar 7, 2018 · 8 comments
Assignees

Comments

@snapwich
Copy link
Collaborator

snapwich commented Mar 7, 2018

Type of issue

bug

Description

Calling pbjs.getAllWinningBids() will not work correctly if you have auctions that have multiple adUnits and therefore have multiple winners. I think the issue resides with the logic in auction.js here: https://github.com/prebid/Prebid.js/blob/master/src/auction.js#L200

An auction instance only allows for setting and getting a singular winning bid when it should allow for multiple winning bids.

Also while looking into this I noticed that auction.setWinningBid and auctionManger.getAllWinningBids all function around calls to pbjs.renderAd, which is somewhat confusing since it's a different code path than what is used in targeting for getting winning bids. I think either pbjs.getAllWinningBids() should use a similar code path that is used in targeting.getWinningBids to eliminate the possibility of discrepancies between the two OR pbjs.getAllWinningBids() should be renamed to eliminate confusion, maybe pbjs.getAllRenderedBids() or something?

Steps to reproduce

Create an auction with multiple adUnits and call pbjs.getAllWinningBids() after the auction has ran.

Expected results

It returns all of the bids rendered.

Actual results

It returns the last bid rendered.

Other information

This causes the issues highlighted in #2190

@jaiminpanchal27 jaiminpanchal27 self-assigned this Mar 7, 2018
@snapwich
Copy link
Collaborator Author

snapwich commented Mar 7, 2018

After discussing, I think we've decided that, to help prevent discrepancies and confusion around naming, pbjs.getAllWinningBids() should be renamed to pbjs.getAllRenderedBids(). The old function can stay around with a deprecation warning.

@chefbenjamin
Copy link

Just curious where this is right now ?

@jaiminpanchal27
Copy link
Collaborator

@chefbenjamin We will ship this in next release

@chefbenjamin
Copy link

@jaiminpanchal27 1.6 ?

@stale
Copy link

stale bot commented Apr 9, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 9, 2018
@chefbenjamin
Copy link

@jaiminpanchal27 @mkendall07 @snapwich I see that #2328 is finished. Does the snippet here have to be changed ? http://prebid.org/dev-docs/toubleshooting-tips.html#see-all-bids-in-the-console

also would be good to add a column here which showed if the bid is client side or server side.

@stale stale bot removed the stale label Apr 9, 2018
@jaiminpanchal27
Copy link
Collaborator

@chefbenjamin Snippet should work as it is. Also since it's a core change, it requires 2nd review so it need some more time to be merged.

Yes adding new column makes sense, will update snippet

@chefbenjamin
Copy link

@jaiminpanchal27 @mkendall07 @snapwich we just pushed 1.8 on a few sites and I can confirm the multiple render issue related to the snippet is fixed. thankyou.

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

No branches or pull requests

4 participants