Skip to content

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

Closed
mp-12301 wants to merge 1 commit intoprebid:masterfrom
aol:contrib/post-bid
Closed

Make sure AUCTION_END event is dispatched before BID_WON event in a post-bid scenario.#852
mp-12301 wants to merge 1 commit intoprebid:masterfrom
aol:contrib/post-bid

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


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

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

Comments