Skip to content

Commit

Permalink
Adnuntius Bid Adapter : bugfix void au ids (#10890)
Browse files Browse the repository at this point in the history
* Removed linting issues

* Fixed merge issues.

* Bugfix on storageTool.

* Adnuntius Bid Adapter: bugfix handling ad response

Handle no voidAuIds better.

---------

Co-authored-by: Mikael Lundin <mikael@coil.se>
Co-authored-by: Mikael Lundin <mikael-lundin@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 5, 2024
1 parent cdbe68c commit 7f2763d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const storageTool = (function () {
}

const updateVoidAuIds = function (currentVoidAuIds, auIdsAsString) {
const newAuIds = auIdsAsString ? auIdsAsString.split(';') : [];
const newAuIds = isStr(auIdsAsString) ? auIdsAsString.split(';') : [];
const notNewExistingAuIds = currentVoidAuIds.filter(auIdObj => {
return newAuIds.indexOf(auIdObj.value) < -1;
}) || [];
Expand All @@ -83,7 +83,7 @@ const storageTool = (function () {
}
}
}
const currentAuIds = updateVoidAuIds(metaAsObj.voidAuIds || [], apiResponse.voidAuIds || []);
const currentAuIds = updateVoidAuIds(metaAsObj.voidAuIds || [], apiResponse.voidAuIds);
if (currentAuIds.length > 0) {
metaAsObj.voidAuIds = { value: currentAuIds };
}
Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/adnuntiusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ describe('adnuntiusBidAdapter', function() {
]
};
serverResponse.body.adUnits[0].deals = [];
delete serverResponse.body.metaData.voidAuIds; // test response with no voidAuIds

const interpretedResponse = spec.interpretResponse(serverResponse, altBidder);
expect(interpretedResponse).to.have.lengthOf(0);
Expand Down

0 comments on commit 7f2763d

Please sign in to comment.