Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

priceFloors: Prevent warning when floor price value is 0 #10701

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/priceFloors.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ export const addBidResponseHook = timedBidResponseHook('priceFloors', function a
let floorInfo = getFirstMatchingFloor(floorData.data, matchingBidRequest, {...bid, size: [bid.width, bid.height]});

if (!floorInfo.matchingFloor) {
logWarn(`${MODULE_NAME}: unable to determine a matching price floor for bidResponse`, bid);
if (floorInfo.matchingFloor !== 0) logWarn(`${MODULE_NAME}: unable to determine a matching price floor for bidResponse`, bid);
return fn.call(this, adUnitCode, bid, reject);
}

Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/priceFloors_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2011,6 +2011,12 @@ describe('the price floors module', function () {
expect(returnedBidResponse).to.not.haveOwnProperty('floorData');
expect(logWarnSpy.calledOnce).to.equal(true);
});
it('if it finds a rule with a floor price of zero it should not call log warn', function () {
_floorDataForAuction[AUCTION_ID] = utils.deepClone(basicFloorConfig);
_floorDataForAuction[AUCTION_ID].data.values = { '*': 0 };
runBidResponse();
expect(logWarnSpy.calledOnce).to.equal(false);
});
it('if it finds a rule and floors should update the bid accordingly', function () {
_floorDataForAuction[AUCTION_ID] = utils.deepClone(basicFloorConfig);
_floorDataForAuction[AUCTION_ID].data.values = { 'banner': 1.0 };
Expand Down