From dd828243f3c81fa6401f924e7a9a02bdb07927a9 Mon Sep 17 00:00:00 2001 From: Rich Snapp Date: Thu, 15 Feb 2018 11:48:33 -0700 Subject: [PATCH] only count bid timeouts if bidder didn't call done. fixes #2146 --- src/auction.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/auction.js b/src/auction.js index 0af6458ac09..43d05f82051 100644 --- a/src/auction.js +++ b/src/auction.js @@ -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 * @@ -493,7 +493,8 @@ function groupByPlacement(bidsByPlacement, bid) { * @return {Array} 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); @@ -501,7 +502,7 @@ function getTimedOutBids(bidderRequests, bidsReceived) { .map(bid => bid.bidder) .filter(uniques); - const timedOutBidderCodes = bidRequestedCodes + const timedOutBidderCodes = bidRequestedWithoutDoneCodes .filter(bidder => !includes(bidReceivedCodes, bidder)); const timedOutBids = bidderRequests