Skip to content
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
4 changes: 2 additions & 2 deletions modules/intentIqIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

function verifyIdType(value) {
if (value === 0 || value === 1 || value === 3 || value === 4) return value;
return -1;

Check warning on line 105 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

105 line is not covered with tests
}

function appendPartnersFirstParty(url, configParams) {
Expand Down Expand Up @@ -148,7 +148,7 @@
+d[3]
);
} catch (e) {
return NaN;

Check warning on line 151 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

151 line is not covered with tests
}
}

Expand Down Expand Up @@ -280,11 +280,11 @@
storeCounters(allowedStorage, partnerData);
}

function storeCounters(storage, partnerData) {
function storeCounters(allowedStorage, partnerData) {
partnerData.callCount = callCount;
partnerData.failCount = failCount;
partnerData.noDataCounter = noDataCount;
storeData(PARTNER_DATA_KEY, JSON.stringify(partnerData), storage, firstPartyData);
storeData(PARTNER_DATA_KEY, JSON.stringify(partnerData), allowedStorage, firstPartyData);
}

/** @type {Submodule} */
Expand Down Expand Up @@ -421,7 +421,7 @@
if (chSupported) {
chPromise = fetchAndHandleCH();
chPromise.catch(err => {
logError('fetchAndHandleCH failed', err);

Check warning on line 424 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

424 line is not covered with tests
});
} else {
clientHints = '';
Expand All @@ -437,8 +437,8 @@
if (typeof partnerData.failCount === 'number') failCount = partnerData.failCount;
if (typeof partnerData.noDataCounter === 'number') noDataCount = partnerData.noDataCounter;
if (partnerData.wsrvcll) {
partnerData.wsrvcll = false;
storeData(PARTNER_DATA_KEY, JSON.stringify(partnerData), allowedStorage, firstPartyData);

Check warning on line 441 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

440-441 lines are not covered with tests
}

if (partnerData.data) {
Expand Down Expand Up @@ -505,7 +505,7 @@
.then(ch => buildAndSendPixel(ch || ''));
}
} else {
buildAndSendPixel('');

Check warning on line 508 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

508 line is not covered with tests
}
return;
}
Expand Down Expand Up @@ -568,7 +568,7 @@
};
if (callbackTimeoutID) clearTimeout(callbackTimeoutID);
if ('cttl' in respJson) {
partnerData.cttl = respJson.cttl;

Check warning on line 571 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

571 line is not covered with tests
} else partnerData.cttl = HOURS_72;

if ('tc' in respJson) {
Expand Down Expand Up @@ -609,7 +609,7 @@
}
// If data is empty, means we should save as INVALID_ID
if (respJson.data === '') {
respJson.data = INVALID_ID;

Check warning on line 612 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

612 line is not covered with tests
} else {
// If data is a single string, assume it is an id with source intentiq.com
if (respJson.data && typeof respJson.data === 'string') {
Expand All @@ -624,7 +624,7 @@
}

if ('sid' in respJson) {
partnerData.siteId = respJson.sid;

Check warning on line 627 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

627 line is not covered with tests
}

if ('spd' in respJson) {
Expand All @@ -633,14 +633,14 @@
}

if ('abTestUuid' in respJson) {
if ('ls' in respJson && respJson.ls === true) {
partnerData.abTestUuid = respJson.abTestUuid;

Check warning on line 637 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

636-637 lines are not covered with tests
}
}

if ('gpr' in respJson) {
// GAM prediction reporting
partnerData.gpr = respJson.gpr;

Check warning on line 643 in modules/intentIqIdSystem.js

View workflow job for this annotation

GitHub Actions / Coverage

643 line is not covered with tests
} else {
delete partnerData.gpr; // remove prediction flag in case server doesn't provide it
}
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/intentIqIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ describe('IntentIQ tests', function () {
uspString: null
};

storeData(FIRST_PARTY_KEY, JSON.stringify(FPD), allowedStorage, storage);
storeData(FIRST_PARTY_KEY, JSON.stringify(FPD), allowedStorage, FPD);
const callBackSpy = sinon.spy();
const submoduleCallback = intentIqIdSubmodule.getId({ ...allConfigParams, params: { ...allConfigParams.params, partner: newPartnerId } }).callback;
submoduleCallback(callBackSpy);
Expand All @@ -830,7 +830,7 @@ describe('IntentIQ tests', function () {
uspString: null
};

storeData(FIRST_PARTY_KEY, JSON.stringify(FPD), allowedStorage, storage);
storeData(FIRST_PARTY_KEY, JSON.stringify(FPD), allowedStorage, FPD);
const returnedObject = intentIqIdSubmodule.getId({ ...allConfigParams, params: { ...allConfigParams.params, partner: newPartnerId } });
await waitForClientHints();
expect(returnedObject.callback).to.be.undefined;
Expand Down
Loading