From 779146a511896f0ae9cfa1ec8aad05a094b46e89 Mon Sep 17 00:00:00 2001 From: Viktor Dreiling <34981284+3link@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:35:41 +0200 Subject: [PATCH] LiveIntent UserId module: fix Ajax timeout when calling the collector endpoint (#10425) * Update LiveConnect * Separate timeout for the collctor * Update package-lock.json * Fix package-lock --- modules/liveIntentIdSystem.js | 7 ++++--- package-lock.json | 18 +++++++++--------- package.json | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/liveIntentIdSystem.js b/modules/liveIntentIdSystem.js index 2d9e6b63a35..8fab266ecce 100644 --- a/modules/liveIntentIdSystem.js +++ b/modules/liveIntentIdSystem.js @@ -12,6 +12,7 @@ import { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js'; import {getStorageManager} from '../src/storageManager.js'; import {MODULE_TYPE_UID} from '../src/activities/modules.js'; +const DEFAULT_AJAX_TIMEOUT = 5000 const EVENTS_TOPIC = 'pre_lips' const MODULE_NAME = 'liveIntentId'; const LI_PROVIDER_DOMAIN = 'liveintent.com'; @@ -65,6 +66,7 @@ function parseLiveIntentCollectorConfig(collectConfig) { collectConfig.fpiStorageStrategy && (config.storageStrategy = collectConfig.fpiStorageStrategy); collectConfig.fpiExpirationDays && (config.expirationDays = collectConfig.fpiExpirationDays); collectConfig.collectorUrl && (config.collectorUrl = collectConfig.collectorUrl); + config.ajaxTimeout = collectConfig.ajaxTimeout || DEFAULT_AJAX_TIMEOUT; return config; } @@ -99,9 +101,8 @@ function initializeLiveConnect(configParams) { if (configParams.url) { identityResolutionConfig.url = configParams.url } - if (configParams.ajaxTimeout) { - identityResolutionConfig.ajaxTimeout = configParams.ajaxTimeout; - } + + identityResolutionConfig.ajaxTimeout = configParams.ajaxTimeout || DEFAULT_AJAX_TIMEOUT; const liveConnectConfig = parseLiveIntentCollectorConfig(configParams.liCollectConfig); diff --git a/package-lock.json b/package-lock.json index dbfc057de9f..b0de52e2d6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "express": "^4.15.4", "fun-hooks": "^0.9.9", "just-clone": "^1.0.2", - "live-connect-js": "^6.0.0" + "live-connect-js": "^6.0.1" }, "devDependencies": { "@babel/eslint-parser": "^7.16.5", @@ -16260,12 +16260,12 @@ } }, "node_modules/live-connect-js": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-6.0.0.tgz", - "integrity": "sha512-4iMSeDPpueYoGEK4U152yKg+hj7jTxkzyfJUAGxtVHxdgjsjh8QmP3kLlTLBBrR/g/L/WCX47PBQxtGW9z8Rlw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-6.0.1.tgz", + "integrity": "sha512-+TwM7cjgyutqaMNlTQKNY9nJFDPpSWfoazSHmlWxOPlimp10PSZGABIbtulNGGpYbR/Zxgc+C/uW5OxqcNEPXg==", "dependencies": { "live-connect-common": "^3.0.0", - "live-connect-handlers": "^2.0.0", + "live-connect-handlers": "^2.1.0", "tiny-hashes": "1.0.1" }, "engines": { @@ -37923,12 +37923,12 @@ } }, "live-connect-js": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-6.0.0.tgz", - "integrity": "sha512-4iMSeDPpueYoGEK4U152yKg+hj7jTxkzyfJUAGxtVHxdgjsjh8QmP3kLlTLBBrR/g/L/WCX47PBQxtGW9z8Rlw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-6.0.1.tgz", + "integrity": "sha512-+TwM7cjgyutqaMNlTQKNY9nJFDPpSWfoazSHmlWxOPlimp10PSZGABIbtulNGGpYbR/Zxgc+C/uW5OxqcNEPXg==", "requires": { "live-connect-common": "^3.0.0", - "live-connect-handlers": "^2.0.0", + "live-connect-handlers": "^2.1.0", "tiny-hashes": "1.0.1" } }, diff --git a/package.json b/package.json index a95acbb8cfe..577f10f4c17 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "express": "^4.15.4", "fun-hooks": "^0.9.9", "just-clone": "^1.0.2", - "live-connect-js": "^6.0.0" + "live-connect-js": "^6.0.1" }, "optionalDependencies": { "fsevents": "^2.3.2"