From 9587bd224840ba665f0287b53c96a289f3cd04bd Mon Sep 17 00:00:00 2001 From: Ryan Schweitzer Date: Thu, 26 Sep 2019 19:24:27 +0200 Subject: [PATCH] removed targeting set filter and moved where render status is set to work with safeframe creatives --- src/auctionManager.js | 1 + src/prebid.js | 1 - src/targeting.js | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auctionManager.js b/src/auctionManager.js index 53ff154bfd1..2040a6387b0 100644 --- a/src/auctionManager.js +++ b/src/auctionManager.js @@ -35,6 +35,7 @@ export function newAuctionManager() { auctionManager.addWinningBid = function(bid) { const auction = find(_auctions, auction => auction.getAuctionId() === bid.auctionId); if (auction) { + bid.status = CONSTANTS.BID_STATUS.RENDERED; auction.addWinningBid(bid); } else { utils.logWarn(`Auction not found when adding winning bid`); diff --git a/src/prebid.js b/src/prebid.js index efa1198d36c..11bdd07afaa 100644 --- a/src/prebid.js +++ b/src/prebid.js @@ -304,7 +304,6 @@ $$PREBID_GLOBAL$$.renderAd = function (doc, id) { // lookup ad by ad Id const bid = auctionManager.findBidByAdId(id); if (bid) { - bid.status = CONSTANTS.BID_STATUS.RENDERED; // replace macros according to openRTB with price paid = bid.cpm bid.ad = utils.replaceAuctionPrice(bid.ad, bid.cpm); bid.adUrl = utils.replaceAuctionPrice(bid.adUrl, bid.cpm); diff --git a/src/targeting.js b/src/targeting.js index 33108f9a6a4..189349dca8e 100644 --- a/src/targeting.js +++ b/src/targeting.js @@ -21,8 +21,8 @@ export const TARGETING_KEYS = Object.keys(CONSTANTS.TARGETING_KEYS).map( // return unexpired bids const isBidNotExpired = (bid) => (bid.responseTimestamp + bid.ttl * 1000 + TTL_BUFFER) > timestamp(); -// return bids whose status is not set. Winning bid can have status `targetingSet` or `rendered`. -const isUnusedBid = (bid) => bid && ((bid.status && !includes([CONSTANTS.BID_STATUS.BID_TARGETING_SET, CONSTANTS.BID_STATUS.RENDERED], bid.status)) || !bid.status); +// 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); export let filters = { isBidNotExpired,