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

Make sure AUCTION_END event is dispatched before BID_WON event in a post-bid scenario. #852

Closed
wants to merge 1 commit into from

Conversation

mp-12301
Copy link
Contributor

@mp-12301 mp-12301 commented Dec 5, 2016

Type of change

  • Bugfix
  • Refactoring

Description of change

Updated to have the AUCTION_END event dispatched before BID_WON event in a post-bid scenario where pbjs.renderAd is called inside the pbjs.requestBids handler.

Other information

#797

@@ -257,13 +257,13 @@ exports.executeCallback = function (timedOut) {

//execute one time callback
if (externalCallbacks.oneTime) {
$$PREBID_GLOBAL$$.clearAuction();
Copy link
Member

Choose a reason for hiding this comment

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

We may have some timing issues with moving this up. @protonate to review

@protonate protonate self-assigned this Dec 5, 2016
@mp-12301
Copy link
Contributor Author

Hey guys any update on this?

@protonate
Copy link
Collaborator

Actually AUCTION_END is intended to fire after BID_WON events. I apologize for not catching this sooner. As it is the clearAuction() function will initiate a new "auction" if there is a pending request in bidsRequestQueue, so this change would introduce timing issues as @mkendall07 mentioned.

Perhaps what is wanted is an AUCTION_CLOSED event which could be emitted at the top of bidmanager.executeCallback():
https://github.com/prebid/Prebid.js/blob/master/src/bidmanager.js#L239

@protonate
Copy link
Collaborator

See #884 for possible solution.

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