diff --git a/package-lock.json b/package-lock.json index e808cad8e6..4bd7423338 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rudderstack/analytics-js-monorepo", - "version": "3.38.0", + "version": "3.39.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rudderstack/analytics-js-monorepo", - "version": "3.38.0", + "version": "3.39.0", "hasInstallScript": true, "license": "Elastic-2.0", "workspaces": [ @@ -25265,7 +25265,7 @@ }, "packages/analytics-js": { "name": "@rudderstack/analytics-js", - "version": "3.7.14", + "version": "3.7.15", "license": "Elastic-2.0", "dependencies": { "@preact/signals-core": "1.8.0", @@ -25325,7 +25325,7 @@ }, "packages/analytics-js-plugins": { "name": "@rudderstack/analytics-js-plugins", - "version": "3.4.14", + "version": "3.4.15", "license": "Elastic-2.0", "dependencies": { "@rudderstack/analytics-js-common": "*", @@ -25369,7 +25369,7 @@ }, "packages/loading-scripts": { "name": "@rudderstack/analytics-js-loading-scripts", - "version": "3.0.31", + "version": "3.0.32", "license": "Elastic-2.0", "dependencies": { "@rudderstack/analytics-js": "*" @@ -25378,7 +25378,7 @@ }, "packages/sanity-suite": { "name": "@rudderstack/analytics-js-sanity-suite", - "version": "3.1.22", + "version": "3.1.23", "license": "Elastic-2.0", "dependencies": { "@rudderstack/analytics-js": "*", diff --git a/package.json b/package.json index 8483d0967c..162750feff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-monorepo", - "version": "3.38.0", + "version": "3.39.0", "private": true, "description": "Monorepo for RudderStack Analytics JS SDK", "workspaces": [ diff --git a/packages/analytics-js-plugins/CHANGELOG.md b/packages/analytics-js-plugins/CHANGELOG.md index eed91543ab..a96d39ac94 100644 --- a/packages/analytics-js-plugins/CHANGELOG.md +++ b/packages/analytics-js-plugins/CHANGELOG.md @@ -2,6 +2,12 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.4.15](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.4.14...@rudderstack/analytics-js-plugins@3.4.15) (2024-10-03) + +### Dependency Updates + +* `@rudderstack/analytics-js` updated to version `3.7.14` +* `@rudderstack/analytics-js-cookies` updated to version `0.3.9` ## [3.4.14](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.4.13...@rudderstack/analytics-js-plugins@3.4.14) (2024-09-27) ### Dependency Updates diff --git a/packages/analytics-js-plugins/CHANGELOG_LATEST.md b/packages/analytics-js-plugins/CHANGELOG_LATEST.md index 8cbea67333..6c0ad1498a 100644 --- a/packages/analytics-js-plugins/CHANGELOG_LATEST.md +++ b/packages/analytics-js-plugins/CHANGELOG_LATEST.md @@ -1,12 +1,6 @@ -## [3.4.14](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.4.13...@rudderstack/analytics-js-plugins@3.4.14) (2024-09-27) +## [3.4.15](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.4.14...@rudderstack/analytics-js-plugins@3.4.15) (2024-10-03) ### Dependency Updates -* `@rudderstack/analytics-js-common` updated to version `3.9.3` -* `@rudderstack/analytics-js` updated to version `3.7.13` - -### Bug Fixes - -* filter non error type errors ([#1865](https://github.com/rudderlabs/rudder-sdk-js/issues/1865)) ([060f66c](https://github.com/rudderlabs/rudder-sdk-js/commit/060f66cbf33500d6e0ee47c788ed687f4f619a57)) -* upgrade all packages to latest to fix vulnerabilities ([#1867](https://github.com/rudderlabs/rudder-sdk-js/issues/1867)) ([389348c](https://github.com/rudderlabs/rudder-sdk-js/commit/389348cfa61f2111c5ac4f9e2bad5851a466484d)) - +* `@rudderstack/analytics-js` updated to version `3.7.14` +* `@rudderstack/analytics-js-cookies` updated to version `0.3.9` diff --git a/packages/analytics-js-plugins/package.json b/packages/analytics-js-plugins/package.json index eba157824c..bdfb36e525 100644 --- a/packages/analytics-js-plugins/package.json +++ b/packages/analytics-js-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-plugins", - "version": "3.4.14", + "version": "3.4.15", "private": true, "description": "RudderStack JavaScript SDK plugins", "main": "dist/npm/modern/cjs/index.cjs", diff --git a/packages/analytics-js-plugins/project.json b/packages/analytics-js-plugins/project.json index b9281dacd4..c79b679d2f 100644 --- a/packages/analytics-js-plugins/project.json +++ b/packages/analytics-js-plugins/project.json @@ -51,9 +51,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js-plugins@3.4.14", - "title": "@rudderstack/analytics-js-plugins@3.4.14", - "discussion-category": "@rudderstack/analytics-js-plugins@3.4.14", + "tag": "@rudderstack/analytics-js-plugins@3.4.15", + "title": "@rudderstack/analytics-js-plugins@3.4.15", + "discussion-category": "@rudderstack/analytics-js-plugins@3.4.15", "notesFile": "./packages/analytics-js-plugins/CHANGELOG_LATEST.md" } } diff --git a/packages/analytics-js/CHANGELOG.md b/packages/analytics-js/CHANGELOG.md index 12ab7b5130..9f74d37513 100644 --- a/packages/analytics-js/CHANGELOG.md +++ b/packages/analytics-js/CHANGELOG.md @@ -2,6 +2,16 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.7.15](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.7.14...@rudderstack/analytics-js@3.7.15) (2024-10-03) + +### Dependency Updates + +* `@rudderstack/analytics-js-plugins` updated to version `3.4.15` + +### Bug Fixes + +* storage access error when cookies are blocked ([#1872](https://github.com/rudderlabs/rudder-sdk-js/issues/1872)) ([966dbc2](https://github.com/rudderlabs/rudder-sdk-js/commit/966dbc2996b0ee292a553058ef435154de73f42e)) + ## [3.7.14](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.7.13...@rudderstack/analytics-js@3.7.14) (2024-09-27) ### Dependency Updates diff --git a/packages/analytics-js/CHANGELOG_LATEST.md b/packages/analytics-js/CHANGELOG_LATEST.md index eb13e5b79c..d2f5050337 100644 --- a/packages/analytics-js/CHANGELOG_LATEST.md +++ b/packages/analytics-js/CHANGELOG_LATEST.md @@ -1,14 +1,10 @@ -## [3.7.14](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.7.13...@rudderstack/analytics-js@3.7.14) (2024-09-27) +## [3.7.15](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.7.14...@rudderstack/analytics-js@3.7.15) (2024-10-03) ### Dependency Updates -* `@rudderstack/analytics-js-cookies` updated to version `0.3.9` -* `@rudderstack/analytics-js-common` updated to version `3.9.3` -* `@rudderstack/analytics-js-plugins` updated to version `3.4.14` +* `@rudderstack/analytics-js-plugins` updated to version `3.4.15` ### Bug Fixes -* add explicit checking for setting user and group traits ([68b4293](https://github.com/rudderlabs/rudder-sdk-js/commit/68b4293a9817b3a113af5f4ad8bfcfcf1cc81e88)) -* auto session tracking ([#1856](https://github.com/rudderlabs/rudder-sdk-js/issues/1856)) ([fa7cce4](https://github.com/rudderlabs/rudder-sdk-js/commit/fa7cce494a4dce00f843ce5790ceccb0fa9ce95f)) -* upgrade all packages to latest to fix vulnerabilities ([#1867](https://github.com/rudderlabs/rudder-sdk-js/issues/1867)) ([389348c](https://github.com/rudderlabs/rudder-sdk-js/commit/389348cfa61f2111c5ac4f9e2bad5851a466484d)) +* storage access error when cookies are blocked ([#1872](https://github.com/rudderlabs/rudder-sdk-js/issues/1872)) ([966dbc2](https://github.com/rudderlabs/rudder-sdk-js/commit/966dbc2996b0ee292a553058ef435154de73f42e)) diff --git a/packages/analytics-js/__tests__/components/capabilitiesManager/detection/storage.test.ts b/packages/analytics-js/__tests__/components/capabilitiesManager/detection/storage.test.ts index a1c7c5b7ad..cbb759dcca 100644 --- a/packages/analytics-js/__tests__/components/capabilitiesManager/detection/storage.test.ts +++ b/packages/analytics-js/__tests__/components/capabilitiesManager/detection/storage.test.ts @@ -1,3 +1,4 @@ +import type { ILogger } from '@rudderstack/analytics-js-common/types/Logger'; import { isStorageQuotaExceeded, isStorageAvailable, @@ -24,4 +25,78 @@ describe('Capabilities Detection - Storage', () => { it('should detect if memoryStorage is available', () => { expect(isStorageAvailable('memoryStorage', new InMemoryStorage())).toBeTruthy(); }); + + it('should log a warning when storage is unavailable', () => { + const mockLogger = { + warn: jest.fn(), + } as ILogger; + + // Store the original descriptor so we can restore it later + const originalLsDescriptor = Object.getOwnPropertyDescriptor(window, 'localStorage'); + const originalSessionStorageDescriptor = Object.getOwnPropertyDescriptor( + window, + 'sessionStorage', + ); + + // Mock using Object.defineProperty + Object.defineProperty(window, 'localStorage', { + get: jest.fn(), + set: jest.fn(), + configurable: true, + }); + + // Mock using Object.defineProperty + Object.defineProperty(window, 'sessionStorage', { + get: jest.fn(), + set: jest.fn(), + configurable: true, + }); + + isStorageAvailable('localStorage', undefined, mockLogger); + expect(mockLogger.warn).toHaveBeenCalledWith( + 'CapabilitiesManager:: The "localStorage" storage type is unavailable.', + undefined, + ); + + isStorageAvailable('sessionStorage', undefined, mockLogger); + expect(mockLogger.warn).toHaveBeenCalledWith( + 'CapabilitiesManager:: The "sessionStorage" storage type is unavailable.', + undefined, + ); + + // Restore the original document.cookie descriptor + Object.defineProperty(window, 'localStorage', originalLsDescriptor as PropertyDescriptor); + Object.defineProperty( + window, + 'sessionStorage', + originalSessionStorageDescriptor as PropertyDescriptor, + ); + }); + + it('should log a warning when the local storage is full', () => { + const mockLogger = { + warn: jest.fn(), + } as ILogger; + + // Store the original descriptor so we can restore it later + const originalLsDescriptor = Object.getOwnPropertyDescriptor(window, 'localStorage'); + + // Mock using Object.defineProperty + Object.defineProperty(window, 'localStorage', { + get: jest.fn(() => { + throw new DOMException('StorageQuotaExceeded', 'QuotaExceededError'); + }), + set: jest.fn(), + configurable: true, + }); + + isStorageAvailable('localStorage', undefined, mockLogger); + expect(mockLogger.warn).toHaveBeenCalledWith( + 'CapabilitiesManager:: The "localStorage" storage type is full.', + new DOMException('StorageQuotaExceeded', 'QuotaExceededError'), + ); + + // Restore the original document.cookie descriptor + Object.defineProperty(window, 'localStorage', originalLsDescriptor as PropertyDescriptor); + }); }); diff --git a/packages/analytics-js/__tests__/services/StoreManager/storages/sessionStorage.test.ts b/packages/analytics-js/__tests__/services/StoreManager/storages/sessionStorage.test.ts index 8ca7a2c331..b3e219e649 100644 --- a/packages/analytics-js/__tests__/services/StoreManager/storages/sessionStorage.test.ts +++ b/packages/analytics-js/__tests__/services/StoreManager/storages/sessionStorage.test.ts @@ -28,4 +28,26 @@ describe('SessionStorage', () => { expect(engine.keys()).toStrictEqual([]); expect(engine.length).toStrictEqual(0); }); + + it('APIs should respond appropriate when session storage is not available', () => { + const sessionStorageEngine = getStorageEngine('sessionStorage'); + + sessionStorageEngine.store = undefined; + + sessionStorageEngine.setItem('a', '1'); + expect(sessionStorageEngine.length).toBe(0); + expect(sessionStorageEngine.getItem('a')).toBeNull(); + + sessionStorageEngine.removeItem('a'); + + expect(sessionStorageEngine.length).toBe(0); + + // clear all entries + sessionStorageEngine.clear(); + expect(sessionStorageEngine.length).toBe(0); + + expect(sessionStorageEngine.key(0)).toBeNull(); + + expect(sessionStorageEngine.keys()).toEqual([]); + }); }); diff --git a/packages/analytics-js/package.json b/packages/analytics-js/package.json index 5aa5a11019..27c472d227 100644 --- a/packages/analytics-js/package.json +++ b/packages/analytics-js/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js", - "version": "3.7.14", + "version": "3.7.15", "description": "RudderStack JavaScript SDK", "main": "dist/npm/modern/cjs/index.cjs", "module": "dist/npm/modern/esm/index.mjs", diff --git a/packages/analytics-js/project.json b/packages/analytics-js/project.json index 3b9c94ccba..8919ca54f5 100644 --- a/packages/analytics-js/project.json +++ b/packages/analytics-js/project.json @@ -59,9 +59,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js@3.7.14", - "title": "@rudderstack/analytics-js@3.7.14", - "discussion-category": "@rudderstack/analytics-js@3.7.14", + "tag": "@rudderstack/analytics-js@3.7.15", + "title": "@rudderstack/analytics-js@3.7.15", + "discussion-category": "@rudderstack/analytics-js@3.7.15", "notesFile": "./packages/analytics-js/CHANGELOG_LATEST.md" } } diff --git a/packages/analytics-js/src/components/capabilitiesManager/detection/storage.ts b/packages/analytics-js/src/components/capabilitiesManager/detection/storage.ts index 780f73d68a..37267ba8d5 100644 --- a/packages/analytics-js/src/components/capabilitiesManager/detection/storage.ts +++ b/packages/analytics-js/src/components/capabilitiesManager/detection/storage.ts @@ -33,6 +33,11 @@ const isStorageAvailable = ( let storage; let testData; + const msgPrefix = STORAGE_UNAVAILABILITY_ERROR_PREFIX(CAPABILITIES_MANAGER, type); + let reason = 'unavailable'; + let isAccessible = true; + let errObj; + try { switch (type) { case MEMORY_STORAGE: @@ -53,25 +58,29 @@ const isStorageAvailable = ( return false; } - if (!storage) { - return false; + if (storage) { + storage.setItem(testData, 'true'); + if (storage.getItem(testData)) { + storage.removeItem(testData); + return true; + } } - storage.setItem(testData, 'true'); - if (storage.getItem(testData)) { - storage.removeItem(testData); - return true; - } - return false; + isAccessible = false; } catch (err) { - const msgPrefix = STORAGE_UNAVAILABILITY_ERROR_PREFIX(CAPABILITIES_MANAGER, type); - let reason = 'unavailable'; + isAccessible = false; + errObj = err; if (isStorageQuotaExceeded(err)) { reason = 'full'; } - logger?.warn(`${msgPrefix}${reason}.`, err); - return false; } + + if (!isAccessible) { + logger?.warn(`${msgPrefix}${reason}.`, errObj); + } + + // if we've have reached here, it means the storage is not available + return false; }; export { isStorageQuotaExceeded, isStorageAvailable }; diff --git a/packages/analytics-js/src/services/StoreManager/storages/CookieStorage.ts b/packages/analytics-js/src/services/StoreManager/storages/CookieStorage.ts index 1a9dca4169..b857e618fd 100644 --- a/packages/analytics-js/src/services/StoreManager/storages/CookieStorage.ts +++ b/packages/analytics-js/src/services/StoreManager/storages/CookieStorage.ts @@ -37,7 +37,7 @@ class CookieStorage implements IStorage { if (options.sameDomainCookiesOnly) { delete this.options.domain; } - this.isSupportAvailable = isStorageAvailable(COOKIE_STORAGE, this, this.logger); + this.isSupportAvailable = isStorageAvailable(COOKIE_STORAGE, this); this.isEnabled = Boolean(this.options.enabled && this.isSupportAvailable); return this.options; } diff --git a/packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts b/packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts index ecb580dda9..824d0663cc 100644 --- a/packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts +++ b/packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts @@ -31,7 +31,7 @@ class LocalStorage implements IStorage { configure(options: Partial): ILocalStorageOptions { this.options = mergeDeepRight(this.options, options); - this.isSupportAvailable = isStorageAvailable(LOCAL_STORAGE, this, this.logger); + this.isSupportAvailable = isStorageAvailable(LOCAL_STORAGE); this.isEnabled = Boolean(this.options.enabled && this.isSupportAvailable); return this.options; } diff --git a/packages/analytics-js/src/services/StoreManager/storages/sessionStorage.ts b/packages/analytics-js/src/services/StoreManager/storages/sessionStorage.ts index e407ca41ff..9b7776aafe 100644 --- a/packages/analytics-js/src/services/StoreManager/storages/sessionStorage.ts +++ b/packages/analytics-js/src/services/StoreManager/storages/sessionStorage.ts @@ -20,7 +20,7 @@ class SessionStorage implements IStorage { isSupportAvailable = true; isEnabled = true; length = 0; - store = globalThis.sessionStorage; + store?: Storage; constructor(options: ISessionStorageOptions = {}, logger?: ILogger) { this.options = getDefaultSessionStorageOptions(); @@ -30,37 +30,54 @@ class SessionStorage implements IStorage { configure(options: Partial): ISessionStorageOptions { this.options = mergeDeepRight(this.options, options); - this.isSupportAvailable = isStorageAvailable(SESSION_STORAGE, this, this.logger); + this.isSupportAvailable = isStorageAvailable(SESSION_STORAGE); + // when storage is blocked by the user, even accessing the property throws an error + if (this.isSupportAvailable) { + this.store = globalThis.sessionStorage; + } this.isEnabled = Boolean(this.options.enabled && this.isSupportAvailable); return this.options; } setItem(key: string, value: any) { + if (!this.store) { + return; + } this.store.setItem(key, value); this.length = this.store.length; } getItem(key: string): any { + if (!this.store) { + return null; + } const value = this.store.getItem(key); return isUndefined(value) ? null : value; } removeItem(key: string) { + if (!this.store) { + return; + } this.store.removeItem(key); this.length = this.store.length; } clear() { - this.store.clear(); + this.store?.clear(); this.length = 0; } key(index: number): Nullable { - return this.store.key(index); + return this.store?.key(index) ?? null; } keys(): string[] { const keys: string[] = []; + if (!this.store) { + return keys; + } + for (let i = 0; i < this.store.length; i += 1) { const key = this.store.key(i); if (key !== null) { diff --git a/packages/loading-scripts/CHANGELOG.md b/packages/loading-scripts/CHANGELOG.md index 055c8ca5aa..4566f85dc8 100644 --- a/packages/loading-scripts/CHANGELOG.md +++ b/packages/loading-scripts/CHANGELOG.md @@ -2,6 +2,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.0.32](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.31...@rudderstack/analytics-js-loading-scripts@3.0.32) (2024-10-03) + +### Dependency Updates + +* `@rudderstack/analytics-js` updated to version `3.7.15` ## [3.0.31](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.30...@rudderstack/analytics-js-loading-scripts@3.0.31) (2024-09-27) ### Dependency Updates diff --git a/packages/loading-scripts/CHANGELOG_LATEST.md b/packages/loading-scripts/CHANGELOG_LATEST.md index 572de7a42b..33d46af6c3 100644 --- a/packages/loading-scripts/CHANGELOG_LATEST.md +++ b/packages/loading-scripts/CHANGELOG_LATEST.md @@ -1,5 +1,5 @@ -## [3.0.31](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.30...@rudderstack/analytics-js-loading-scripts@3.0.31) (2024-09-27) +## [3.0.32](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.31...@rudderstack/analytics-js-loading-scripts@3.0.32) (2024-10-03) ### Dependency Updates -* `@rudderstack/analytics-js` updated to version `3.7.14` +* `@rudderstack/analytics-js` updated to version `3.7.15` diff --git a/packages/loading-scripts/package.json b/packages/loading-scripts/package.json index 1db175cae8..7cc58e8a9e 100644 --- a/packages/loading-scripts/package.json +++ b/packages/loading-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-loading-scripts", - "version": "3.0.31", + "version": "3.0.32", "private": true, "description": "Loading script for RudderStack JavaScript SDK", "main": "./src/index.js", diff --git a/packages/loading-scripts/project.json b/packages/loading-scripts/project.json index 132f556e93..d4d6ba90b4 100644 --- a/packages/loading-scripts/project.json +++ b/packages/loading-scripts/project.json @@ -51,9 +51,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js-loading-scripts@3.0.31", - "title": "@rudderstack/analytics-js-loading-scripts@3.0.31", - "discussion-category": "@rudderstack/analytics-js-loading-scripts@3.0.31", + "tag": "@rudderstack/analytics-js-loading-scripts@3.0.32", + "title": "@rudderstack/analytics-js-loading-scripts@3.0.32", + "discussion-category": "@rudderstack/analytics-js-loading-scripts@3.0.32", "notesFile": "./packages/loading-scripts/CHANGELOG_LATEST.md" } } diff --git a/packages/sanity-suite/CHANGELOG.md b/packages/sanity-suite/CHANGELOG.md index cb16a27eb3..25416a7d85 100644 --- a/packages/sanity-suite/CHANGELOG.md +++ b/packages/sanity-suite/CHANGELOG.md @@ -2,6 +2,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.1.23](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-sanity-suite@3.1.22...@rudderstack/analytics-js-sanity-suite@3.1.23) (2024-10-03) + +### Dependency Updates + +* `@rudderstack/analytics-js` updated to version `3.7.15` ## [3.1.22](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-sanity-suite@3.1.21...@rudderstack/analytics-js-sanity-suite@3.1.22) (2024-09-27) ### Dependency Updates diff --git a/packages/sanity-suite/__fixtures__/sourceConfig1.json b/packages/sanity-suite/__fixtures__/sourceConfig1.json index 0c48bf1aa9..e11bfd2270 100644 --- a/packages/sanity-suite/__fixtures__/sourceConfig1.json +++ b/packages/sanity-suite/__fixtures__/sourceConfig1.json @@ -26,7 +26,17 @@ "serverUrl": "", "blacklistedEvents": [], "whitelistedEvents": [], - "oneTrustCookieCategories": [], + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + } + ], "eventFilteringOption": "disable" }, "destinationDefinitionId": "1X6kXapk8Sf8yZTJn1dYZO3OXFt", @@ -34,7 +44,7 @@ "name": "GTM", "displayName": "Google Tag Manager" }, - "updatedAt": "2023-11-06T10:42:57.261Z", + "updatedAt": "2024-10-01T10:20:52.025Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -56,21 +66,31 @@ "disableAdPersonalization": false, "blacklistedEvents": [], "whitelistedEvents": [], - "oneTrustCookieCategories": [], + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], "eventFilteringOption": "disable", "dynamicRemarketing": {}, "trackConversions": true, "enableConversionEventsFiltering": false, "trackDynamicRemarketing": false, "allowEnhancedConversions": false, - "enableConversionLabel": false + "enableConversionLabel": false, + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + } + ] }, "destinationDefinitionId": "1X6kXNpFwP2NmnjWGuVWb8qoJ8L", "destinationDefinition": { "name": "GOOGLEADS", "displayName": "Google Ads" }, - "updatedAt": "2023-11-06T10:43:08.815Z", + "updatedAt": "2024-10-01T09:56:28.946Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -82,15 +102,25 @@ "siteID": "3382269", "blacklistedEvents": [], "whitelistedEvents": [], - "oneTrustCookieCategories": [], - "eventFilteringOption": "disable" + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], + "eventFilteringOption": "disable", + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + } + ] }, "destinationDefinitionId": "1SxbQXdfQ2NzIdqNO3GceshF4V0", "destinationDefinition": { "name": "HOTJAR", "displayName": "Hotjar" }, - "updatedAt": "2023-11-06T10:44:20.419Z", + "updatedAt": "2024-10-01T10:20:16.906Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -164,7 +194,7 @@ "name": "AM", "displayName": "Amplitude" }, - "updatedAt": "2023-11-20T11:25:55.490Z", + "updatedAt": "2024-09-18T11:17:44.316Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -203,7 +233,7 @@ "name": "BRAZE", "displayName": "Braze" }, - "updatedAt": "2023-11-06T10:42:45.853Z", + "updatedAt": "2024-09-19T10:57:33.488Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -221,6 +251,12 @@ "useRichEventNames": false, "sampleRate": "100", "siteSpeedSampleRate": "1", + "dimensions": [ + { + "from": "", + "to": "" + } + ], "resetCustomDimensionsOnPage": [], "setAllMappedProps": true, "anonymizeIp": false, @@ -252,7 +288,6 @@ "oneTrustCookieCategory": "C0003" } ], - "eventFilteringOption": "blacklistedEvents", "ketchConsentPurposes": [ { "purpose": "analytics" @@ -261,19 +296,38 @@ "purpose": "another_purpose_id" } ], - "dimensions": [ + "consentManagement": [ { - "from": "", - "to": "" + "provider": "oneTrust", + "consents": [ + { + "consent": "C0001" + }, + { + "consent": "C0003" + } + ] + }, + { + "provider": "ketch", + "consents": [ + { + "consent": "analytics" + }, + { + "consent": "another_purpose_id" + } + ] } - ] + ], + "eventFilteringOption": "blacklistedEvents" }, "destinationDefinitionId": "1QGzNyNSA4alXixnhDcq4C10ac2", "destinationDefinition": { "name": "GA", "displayName": "Google Analytics" }, - "updatedAt": "2023-11-17T11:24:40.377Z", + "updatedAt": "2024-10-01T09:57:51.189Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -305,11 +359,29 @@ } ], "overrideClientAndSessionId": true, - "oneTrustCookieCategories": [], + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], "ketchConsentPurposes": [ { "purpose": "analytics" } + ], + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + }, + { + "provider": "ketch", + "consents": [ + { + "consent": "analytics" + } + ] + } ] }, "destinationDefinitionId": "1mQ0yXGAQM08MTdVxws7ENIPjYS", @@ -317,7 +389,7 @@ "name": "GA4", "displayName": "Google Analytics 4 (GA4)" }, - "updatedAt": "2023-11-06T10:42:12.911Z", + "updatedAt": "2024-10-01T10:07:57.063Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -331,15 +403,25 @@ "fs_host": "", "blacklistedEvents": [], "whitelistedEvents": [], - "oneTrustCookieCategories": [], - "eventFilteringOption": "disable" + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], + "eventFilteringOption": "disable", + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + } + ] }, "destinationDefinitionId": "1aIY8UDEW1vZJ6n21ZO9BmRHgAp", "destinationDefinition": { "name": "FULLSTORY", "displayName": "Fullstory" }, - "updatedAt": "2023-11-06T10:43:33.652Z", + "updatedAt": "2024-10-01T10:13:31.740Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -356,17 +438,27 @@ "propertyBlackList": [], "blacklistedEvents": [], "whitelistedEvents": [], - "oneTrustCookieCategories": [], + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], "enableLocalStoragePersistence": false, "eventFilteringOption": "disable", - "useV2Group": false + "useV2Group": false, + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + } + ] }, "destinationDefinitionId": "1kFwq1W6mIA0COSvz7Zmqsn1DFB", "destinationDefinition": { "name": "POSTHOG", "displayName": "PostHog" }, - "updatedAt": "2023-11-06T10:43:22.164Z", + "updatedAt": "2024-10-01T10:19:05.596Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false }, @@ -393,21 +485,39 @@ "whitelistPiiProperties": [], "blacklistedEvents": [], "whitelistedEvents": [], - "oneTrustCookieCategories": [], - "eventFilteringOption": "disable", - "useUpdatedMapping": false, + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ], "ketchConsentPurposes": [ { "purpose": "" } - ] + ], + "consentManagement": [ + { + "provider": "oneTrust", + "consents": [] + }, + { + "provider": "ketch", + "consents": [ + { + "consent": "" + } + ] + } + ], + "eventFilteringOption": "disable", + "useUpdatedMapping": false }, "destinationDefinitionId": "1aIXpsUVMU38nBFIE4QTiZu9Vxo", "destinationDefinition": { "name": "FACEBOOK_PIXEL", "displayName": "Facebook Pixel" }, - "updatedAt": "2023-11-06T10:44:06.686Z", + "updatedAt": "2024-10-01T10:17:50.293Z", "shouldApplyDeviceModeTransformation": false, "propagateEventsUntransformedOnError": false } diff --git a/packages/sanity-suite/package.json b/packages/sanity-suite/package.json index 14f6bd7da1..e6e3761421 100644 --- a/packages/sanity-suite/package.json +++ b/packages/sanity-suite/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-sanity-suite", - "version": "3.1.22", + "version": "3.1.23", "private": true, "description": "Sanity suite for testing JS SDK package", "main": "./dist/v3/cdn/testBook.js", diff --git a/sonar-project.properties b/sonar-project.properties index 5c7a44206c..623e1517c7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,7 +6,7 @@ sonar.qualitygate.wait=false sonar.projectKey=rudderlabs_rudder-sdk-js sonar.organization=rudderlabs sonar.projectName=rudder-sdk-js -sonar.projectVersion=3.38.0 +sonar.projectVersion=3.39.0 # Meta-data for the project sonar.links.scm=https://github.com/rudderlabs/rudder-sdk-js