From 07f09b6ef979e1270bdc5c9b4cf62008c5077b33 Mon Sep 17 00:00:00 2001 From: jlquaccia Date: Mon, 29 Jan 2024 17:41:13 -0800 Subject: [PATCH 1/5] test pr for circleci --- modules/id5IdSystem.js | 8 ++++---- modules/topicsFpdModule.js | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/id5IdSystem.js b/modules/id5IdSystem.js index b10f3c5d2cf..c585f2fdae0 100644 --- a/modules/id5IdSystem.js +++ b/modules/id5IdSystem.js @@ -51,26 +51,26 @@ export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleNam * @property {string} [universal_uid] - The encrypted ID5 ID to pass to bidders * @property {Object} [ext] - The extensions object to pass to bidders * @property {Object} [ab_testing] - A/B testing configuration -*/ + */ /** * @typedef {Object} FetchCallConfig * @property {string} [url] - The URL for the fetch endpoint * @property {Object} [overrides] - Overrides to apply to fetch parameters -*/ + */ /** * @typedef {Object} ExtensionsCallConfig * @property {string} [url] - The URL for the extensions endpoint * @property {string} [method] - Overrides the HTTP method to use to make the call * @property {Object} [body] - Specifies a body to pass to the extensions endpoint -*/ + */ /** * @typedef {Object} DynamicConfig * @property {FetchCallConfig} [fetchCall] - The fetch call configuration * @property {ExtensionsCallConfig} [extensionsCall] - The extensions call configuration -*/ + */ /** * @typedef {Object} ABTestingConfig diff --git a/modules/topicsFpdModule.js b/modules/topicsFpdModule.js index 617ce0ad6f4..954fbc53885 100644 --- a/modules/topicsFpdModule.js +++ b/modules/topicsFpdModule.js @@ -27,6 +27,9 @@ const bidderIframeList = { }, { bidder: 'rtbhouse', iframeURL: 'https://topics.authorizedvault.com/topicsapi.html' + }, { + bidder: 'improvedigital', + iframeURL: 'https://hb.360yield.com/privacy-sandbox/topics.html' }] } export const coreStorage = getCoreStorageManager(MODULE_NAME); From 624aae55c15d44b3597ef47803bcff09d698d650 Mon Sep 17 00:00:00 2001 From: jlquaccia Date: Tue, 30 Jan 2024 14:58:11 -0800 Subject: [PATCH 2/5] fix for failing topicsFpdModule tests --- modules/topicsFpdModule.js | 3 ++- test/spec/modules/topicsFpdModule_spec.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/topicsFpdModule.js b/modules/topicsFpdModule.js index 954fbc53885..0e08d05f1bc 100644 --- a/modules/topicsFpdModule.js +++ b/modules/topicsFpdModule.js @@ -14,9 +14,11 @@ const MODULE_NAME = 'topicsFpd'; const DEFAULT_EXPIRATION_DAYS = 21; const DEFAULT_FETCH_RATE_IN_DAYS = 1; let LOAD_TOPICS_INITIALISE = false; +let iframeLoadedURL = []; export function reset() { LOAD_TOPICS_INITIALISE = false; + iframeLoadedURL = []; } const bidderIframeList = { @@ -36,7 +38,6 @@ export const coreStorage = getCoreStorageManager(MODULE_NAME); export const topicStorageName = 'prebid:topics'; export const lastUpdated = 'lastUpdated'; -const iframeLoadedURL = []; const TAXONOMIES = { // map from topic taxonomyVersion to IAB segment taxonomy '1': 600, diff --git a/test/spec/modules/topicsFpdModule_spec.js b/test/spec/modules/topicsFpdModule_spec.js index bc7df85db0d..4a79e7f77fd 100644 --- a/test/spec/modules/topicsFpdModule_spec.js +++ b/test/spec/modules/topicsFpdModule_spec.js @@ -384,6 +384,22 @@ describe('topics', () => { }); describe('cross-frame messages', () => { + before(() => { + config.setConfig({ + userSync: { + topics: { + maxTopicCaller: 3, + bidders: [ + { + bidder: 'pubmatic', + iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html' + } + ], + }, + } + }); + }); + beforeEach(() => { // init iframe logic so that the receiveMessage origin check passes loadTopicsForBidders({ @@ -398,6 +414,10 @@ describe('topics', () => { }); }); + after(() => { + config.resetConfig(); + }) + it('should store segments if receiveMessage event is triggered with segment data', () => { receiveMessage(evt); let segments = new Map(safeJSONParse(storage.getDataFromLocalStorage(topicStorageName))); @@ -421,11 +441,13 @@ describe('handles fetch request for topics api headers', () => { beforeEach(() => { stubbedFetch = sinon.stub(window, 'fetch'); + reset(); }); afterEach(() => { stubbedFetch.restore(); storage.removeDataFromLocalStorage(topicStorageName); + config.resetConfig(); }); it('should make a fetch call when a fetchUrl is present for a selected bidder', () => { @@ -444,6 +466,7 @@ describe('handles fetch request for topics api headers', () => { }); stubbedFetch.returns(Promise.resolve(true)); + loadTopicsForBidders({ browsingTopics: true, featurePolicy: { From 6144c999c20a42e6abdcd1d09869df8f3d220b6d Mon Sep 17 00:00:00 2001 From: jlquaccia Date: Tue, 30 Jan 2024 15:41:27 -0800 Subject: [PATCH 3/5] formatting fix --- modules/id5IdSystem.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/id5IdSystem.js b/modules/id5IdSystem.js index c585f2fdae0..b10f3c5d2cf 100644 --- a/modules/id5IdSystem.js +++ b/modules/id5IdSystem.js @@ -51,26 +51,26 @@ export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleNam * @property {string} [universal_uid] - The encrypted ID5 ID to pass to bidders * @property {Object} [ext] - The extensions object to pass to bidders * @property {Object} [ab_testing] - A/B testing configuration - */ +*/ /** * @typedef {Object} FetchCallConfig * @property {string} [url] - The URL for the fetch endpoint * @property {Object} [overrides] - Overrides to apply to fetch parameters - */ +*/ /** * @typedef {Object} ExtensionsCallConfig * @property {string} [url] - The URL for the extensions endpoint * @property {string} [method] - Overrides the HTTP method to use to make the call * @property {Object} [body] - Specifies a body to pass to the extensions endpoint - */ +*/ /** * @typedef {Object} DynamicConfig * @property {FetchCallConfig} [fetchCall] - The fetch call configuration * @property {ExtensionsCallConfig} [extensionsCall] - The extensions call configuration - */ +*/ /** * @typedef {Object} ABTestingConfig From 2cff915128bf21ab7f484deb0c3c6c99687d44d9 Mon Sep 17 00:00:00 2001 From: jlquaccia Date: Tue, 30 Jan 2024 15:50:31 -0800 Subject: [PATCH 4/5] minor refactor --- modules/topicsFpdModule.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/topicsFpdModule.js b/modules/topicsFpdModule.js index 0e08d05f1bc..93bba231054 100644 --- a/modules/topicsFpdModule.js +++ b/modules/topicsFpdModule.js @@ -29,9 +29,6 @@ const bidderIframeList = { }, { bidder: 'rtbhouse', iframeURL: 'https://topics.authorizedvault.com/topicsapi.html' - }, { - bidder: 'improvedigital', - iframeURL: 'https://hb.360yield.com/privacy-sandbox/topics.html' }] } export const coreStorage = getCoreStorageManager(MODULE_NAME); From 0070614d921b2b5c415aba8f1523d916ff496fad Mon Sep 17 00:00:00 2001 From: jlquaccia Date: Tue, 30 Jan 2024 16:27:21 -0800 Subject: [PATCH 5/5] triggered another circle ci build --- modules/topicsFpdModule.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/topicsFpdModule.js b/modules/topicsFpdModule.js index 93bba231054..a31d72fc179 100644 --- a/modules/topicsFpdModule.js +++ b/modules/topicsFpdModule.js @@ -31,6 +31,7 @@ const bidderIframeList = { iframeURL: 'https://topics.authorizedvault.com/topicsapi.html' }] } + export const coreStorage = getCoreStorageManager(MODULE_NAME); export const topicStorageName = 'prebid:topics'; export const lastUpdated = 'lastUpdated';