Skip to content

Commit

Permalink
use TODO and comments instead of quietly removing rule-breaking code
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed Jul 1, 2024
1 parent c8303aa commit 5973d8f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
24 changes: 22 additions & 2 deletions modules/contxtfulRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,28 @@ function getRxEngineReceptivity(requester) {
}

function loadSessionReceptivity(requester) {
return null;
};
// TODO: commented out because of rule violations
/*
let sessionStorageValue = sessionStorage.getItem(requester);
if (!sessionStorageValue) {
return null;
}
try {
// Check expiration of the cached value
let sessionStorageReceptivity = JSON.parse(sessionStorageValue);
let expiration = parseInt(sessionStorageReceptivity?.exp);
if (expiration < new Date().getTime()) {
return null;
}
let rx = sessionStorageReceptivity?.rx;
return rx;
} catch {
return null;
}
*/
}

/**
* Prepare a receptivity batch
Expand Down
19 changes: 16 additions & 3 deletions modules/fintezaAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ function initFirstVisit() {
let now;
let visitDate;
let cookies;
cookies = {};

try {
// TODO: commented out because of rule violations
cookies = {} // parseCookies(document.cookie);
} catch (a) {
cookies = {};
}

visitDate = cookies[ FIRST_VISIT_DATE ];

Expand All @@ -86,6 +92,7 @@ function initFirstVisit() {

return visitDate;
}
// TODO: commented out because of rule violations
/*
function trim(string) {
if (string.trim) {
Expand Down Expand Up @@ -167,7 +174,12 @@ function initSession() {
let sessionDuration;
let isNew = false;

cookies = {};
try {
// TODO: commented out because of rule violations
cookies = {} // parseCookies(document.cookie);
} catch (a) {
cookies = {};
}

sessionId = cookies[ SESSION_ID ];

Expand Down Expand Up @@ -255,7 +267,8 @@ function getTrackRequestLastTime() {
);
}

cookie = {};
// TODO: commented out because of rule violations
cookie = {} // parseCookies(document.cookie);
cookie = cookie[ TRACK_TIME_KEY ];
if (cookie) {
return parseInt(cookie, 10);
Expand Down
3 changes: 2 additions & 1 deletion modules/relevatehealthBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ function buildUser(bid) {
if (bid && bid.params) {
return {
id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '',
buyeruid: '',
// TODO: commented out because of rule violations
buyeruid: '', // localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '',
keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '',
customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : ''
};
Expand Down
14 changes: 10 additions & 4 deletions test/spec/modules/contxtfulRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,22 @@ describe('contxtfulRtdProvider', function () {
];

theories.forEach(([adUnits, expected, _description]) => {
it('does not use non-expired info from session storage and adds receptivity to the ad units using session storage', function (done) {
// TODO: commented out because of rule violations
/*
it('uses non-expired info from session storage and adds receptivity to the ad units using session storage', function (done) {
let config = buildInitConfig(VERSION, CUSTOMER);
// Simulate that there was a write to sessionStorage in the past.
writeToStorage(config.params.customer, +100);
contxtfulSubmodule.init(config);
setTimeout(() => {
expect(contxtfulSubmodule.getTargetingData(adUnits, config)).to.not.equal(
expect(contxtfulSubmodule.getTargetingData(adUnits, config)).to.deep.equal(
expected
);
done();
}, TIMEOUT);
});
*/
});
});

Expand Down Expand Up @@ -453,7 +456,9 @@ describe('contxtfulRtdProvider', function () {
});

describe('getBidRequestData', function () {
it('does not use non-expired info from session storage and adds receptivity to the reqBidsConfigObj', function (done) {
// TODO: commented out because of rule violations
/*
it('uses non-expired info from session storage and adds receptivity to the reqBidsConfigObj', function (done) {
let config = buildInitConfig(VERSION, CUSTOMER);
// Simulate that there was a write to sessionStorage in the past.
writeToStorage(config.params.bidders[0], +100);
Expand Down Expand Up @@ -489,10 +494,11 @@ describe('contxtfulRtdProvider', function () {
const noOp = () => undefined;
contxtfulSubmodule.getBidRequestData(reqBidsConfigObj, noOp, buildInitConfig(VERSION, CUSTOMER));
let actualOrtb2 = reqBidsConfigObj.ortb2Fragments.bidder[config.params.bidders[0]];
expect(actualOrtb2).to.not.equal(expectedOrtb2);
expect(actualOrtb2).to.deep.equal(expectedOrtb2);
done();
}, TIMEOUT);
});
*/
});

describe('getBidRequestData', function () {
Expand Down

0 comments on commit 5973d8f

Please sign in to comment.