From 2ea3f6f86143e0bab5973a7ae3f91a9639ec8efa Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Fri, 12 Feb 2021 12:02:42 -0500 Subject: [PATCH] Update targeting.js to fix TTL buffer arithmetic (#6300) --- src/targeting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/targeting.js b/src/targeting.js index aa80ce6fd5d..cb53ea0fed3 100644 --- a/src/targeting.js +++ b/src/targeting.js @@ -20,7 +20,7 @@ export const TARGETING_KEYS = Object.keys(CONSTANTS.TARGETING_KEYS).map( ); // return unexpired bids -const isBidNotExpired = (bid) => (bid.responseTimestamp + bid.ttl * 1000 + TTL_BUFFER) > timestamp(); +const isBidNotExpired = (bid) => (bid.responseTimestamp + bid.ttl * 1000 - TTL_BUFFER) > timestamp(); // return bids whose status is not set. Winning bids can only have a status of `rendered`. const isUnusedBid = (bid) => bid && ((bid.status && !includes([CONSTANTS.BID_STATUS.RENDERED], bid.status)) || !bid.status);