Skip to content

Commit

Permalink
Update build for timeout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mat Brown committed May 25, 2017
1 parent 4b46258 commit 082e273
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build/dist/prebid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* prebid.js v0.25.0-pre
Updated : 2017-05-24 */
Updated : 2017-05-25 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
Expand Down Expand Up @@ -3024,6 +3024,13 @@ Updated : 2017-05-24 */
return requested === received;
}

function getCurrentRequestId() {
var requested = pbjs._bidsRequested;
if (requested.length > 0) {
return requested[0].requestId;
}
}

exports.bidsBackAll = function () {
return bidsBackAll();
};
Expand Down Expand Up @@ -3056,6 +3063,12 @@ Updated : 2017-05-24 */
adUnitCode: adUnitCode
});

var currentRequestId = getCurrentRequestId();
if (requestId !== currentRequestId) {
utils.logWarn('Got bid response for request ID ' + requestId + ', which does not match current request ID ' + currentRequestId + '. Response discarded.');
return;
}

bid.timeToRespond = bid.responseTimestamp - bid.requestTimestamp;

if (bid.timeToRespond > pbjs.cbTimeout + pbjs.timeoutBuffer) {
Expand Down

0 comments on commit 082e273

Please sign in to comment.