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

Empty bidRequests in AST adapter each time new auction begins #1305

Conversation

dmitriyshashkin
Copy link
Contributor

When error occurs adapter issues response for each bid in bidRequests
therefore bidRequests must be emptied each time new auction begins

Fixes #1304

Type of change

  • Bugfix

Description of change

Empty bidRequests each time new auction begins, because when an error occurs adapter issues a response for each request in this array.

Other information

#1304

therefore bidRequests must be emptied each time new auction begins

Fixes prebid#1304
const placement = bidRequests[bid.adId].placementCode;
bidmanager.addBidResponse(placement, bid);

if (bid.adId in bidRequests) {
Copy link
Member

Choose a reason for hiding this comment

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

is there ever a reason the adId isn't in bidRequests ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, if the response from the 1st auction is extremely slow and arrives after the 2nd auction has already started and bidRequests list has been emptied, then bidRequests will have adId's from the second auction, and adId from the first auction will have no corresponding entry.

Copy link
Member

Choose a reason for hiding this comment

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

yeah that makes sense. In that case we are OK to throw away the bid response so this is ok.

Copy link
Collaborator

@matthewlane matthewlane left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@matthewlane matthewlane merged commit d5e13bc into prebid:master Jun 21, 2017
Yann-Pravo pushed a commit to Yann-Pravo/Prebid.js that referenced this pull request Jul 6, 2017
…#1305)

When error occurs adapter issues response for each bid in `bidRequests` therefore bidRequests must be emptied each time new auction begins

Fixes prebid#1304
jbAdyoulike pushed a commit to jbAdyoulike/Prebid.js that referenced this pull request Sep 21, 2017
…#1305)

When error occurs adapter issues response for each bid in `bidRequests` therefore bidRequests must be emptied each time new auction begins

Fixes prebid#1304
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
…#1305)

When error occurs adapter issues response for each bid in `bidRequests` therefore bidRequests must be emptied each time new auction begins

Fixes prebid#1304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppnexusAST ends refresh auctions prematurely when trying to handle error
5 participants