Skip to content

Commit

Permalink
only count bid timeouts if bidder didn't call done. fixes prebid#2146
Browse files Browse the repository at this point in the history
  • Loading branch information
snapwich committed Feb 15, 2018
1 parent f4fd825 commit dd82824
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function groupByPlacement(bidsByPlacement, bid) {
}

/**
* Returns a list of bids that we haven't received a response yet
* Returns a list of bids that we haven't received a response yet where the bidder did not call done
* @param {BidRequest[]} bidderRequests List of bids requested for auction instance
* @param {BidReceived[]} bidsReceived List of bids received for auction instance
*
Expand All @@ -493,15 +493,16 @@ function groupByPlacement(bidsByPlacement, bid) {
* @return {Array<TimedOutBid>} List of bids that Prebid hasn't received a response for
*/
function getTimedOutBids(bidderRequests, bidsReceived) {
const bidRequestedCodes = bidderRequests
const bidRequestedWithoutDoneCodes = bidderRequests
.filter(bidderRequest => !bidderRequest.doneCbCallCount)
.map(bid => bid.bidderCode)
.filter(uniques);

const bidReceivedCodes = bidsReceived
.map(bid => bid.bidder)
.filter(uniques);

const timedOutBidderCodes = bidRequestedCodes
const timedOutBidderCodes = bidRequestedWithoutDoneCodes
.filter(bidder => !includes(bidReceivedCodes, bidder));

const timedOutBids = bidderRequests
Expand Down

0 comments on commit dd82824

Please sign in to comment.