diff --git a/packages/analytics-browser/package.json b/packages/analytics-browser/package.json index ad0986b2d..bf77e177e 100644 --- a/packages/analytics-browser/package.json +++ b/packages/analytics-browser/package.json @@ -47,7 +47,7 @@ "dependencies": { "@amplitude/analytics-client-common": "^2.3.1", "@amplitude/analytics-core": "^2.5.0", - "@amplitude/analytics-remote-config": "^0.3.5", + "@amplitude/analytics-remote-config": "^0.4.0", "@amplitude/analytics-types": "^2.8.0", "@amplitude/plugin-autocapture-browser": "^1.0.0", "@amplitude/plugin-page-view-tracking-browser": "^2.2.19", diff --git a/packages/analytics-browser/src/config/joined-config.ts b/packages/analytics-browser/src/config/joined-config.ts index 7742c40f7..9b63b470f 100644 --- a/packages/analytics-browser/src/config/joined-config.ts +++ b/packages/analytics-browser/src/config/joined-config.ts @@ -69,12 +69,6 @@ export class BrowserJoinedConfigGenerator { this.config.loggerProvider.debug('Joined configuration: ', JSON.stringify(this.config, null, 2)); this.config.requestMetadata ??= new RequestMetadata(); - if (this.remoteConfigFetch?.metrics.fetchTimeIDB) { - this.config.requestMetadata.recordHistogram( - 'remote_config_fetch_time_IDB', - this.remoteConfigFetch.metrics.fetchTimeIDB, - ); - } if (this.remoteConfigFetch?.metrics.fetchTimeAPISuccess) { this.config.requestMetadata.recordHistogram( 'remote_config_fetch_time_API_success', diff --git a/packages/analytics-browser/test/config/joined-config.test.ts b/packages/analytics-browser/test/config/joined-config.test.ts index 98a72d35d..3ceeb3939 100644 --- a/packages/analytics-browser/test/config/joined-config.test.ts +++ b/packages/analytics-browser/test/config/joined-config.test.ts @@ -324,31 +324,6 @@ describe('joined-config', () => { expect(joinedConfig.requestMetadata?.sdk.metrics.histogram.remote_config_fetch_time_API_fail).toBe(100); expect(joinedConfig.requestMetadata?.sdk.metrics.histogram.remote_config_fetch_time_IDB).toBe(undefined); }); - - test('should set remote config fetch time IDB', async () => { - mockRemoteConfigFetch = { - getRemoteConfig: jest.fn().mockResolvedValue({ - defaultTracking: true, - autocapture: true, - }), - metrics: { - fetchTimeIDB: 100, - }, - }; - - // Mock the createRemoteConfigFetch to return the mockRemoteConfigFetch - (createRemoteConfigFetch as jest.MockedFunction).mockResolvedValue( - mockRemoteConfigFetch, - ); - - await generator.initialize(); - const joinedConfig = await generator.generateJoinedConfig(); - expect(joinedConfig.requestMetadata?.sdk.metrics.histogram.remote_config_fetch_time_API_success).toBe( - undefined, - ); - expect(joinedConfig.requestMetadata?.sdk.metrics.histogram.remote_config_fetch_time_API_fail).toBe(undefined); - expect(joinedConfig.requestMetadata?.sdk.metrics.histogram.remote_config_fetch_time_IDB).toBe(100); - }); }); }); diff --git a/yarn.lock b/yarn.lock index d04880136..e19589588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,15 +7,14 @@ resolved "https://registry.yarnpkg.com/@amplitude/analytics-connector/-/analytics-connector-1.4.8.tgz#dd801303db2662bc51be7e0194eeb8bd72267c42" integrity sha512-dFW7c7Wb6Ng7vbmzwbaXZSpqfBx37ukamJV9ErFYYS8vGZK/Hkbt3M7fZHBI4WFU6CCwakr2ZXPme11uGPYWkQ== -"@amplitude/analytics-remote-config@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-remote-config/-/analytics-remote-config-0.3.5.tgz#b3b9ca15f183a0399c451b9395d9c8281d310e7d" - integrity sha512-jnm/w+/NFSLnjcHSP/MYvdy6RQ7lVqWyAiIw/cTs+iL6cJaoauHuB0gbUnqGTPUhvbUlKa7faz1iiXGwt6HSjA== +"@amplitude/analytics-remote-config@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-remote-config/-/analytics-remote-config-0.4.0.tgz#e9835836ef40c6b2e72bc8c7a88803dda5559556" + integrity sha512-ilp9Dz8Z92V9Wilmz8XIbvEbtuVaN65+jM06JP8I7wL8eNOHVIi4HcI151BzIyekjbprbS1w18Ps3dj2sHlFXA== dependencies: "@amplitude/analytics-client-common" ">=1 <3" "@amplitude/analytics-core" ">=1 <3" "@amplitude/analytics-types" ">=1 <3" - idb "^8.0.0" tslib "^2.4.1" "@amplitude/plugin-autocapture-browser@^1.0.0": @@ -6976,11 +6975,6 @@ iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -idb@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/idb/-/idb-8.0.0.tgz#33d7ed894ed36e23bcb542fb701ad579bfaad41f" - integrity sha512-l//qvlAKGmQO31Qn7xdzagVPPaHTxXx199MhrAFuVBTPqydcPYBWjkrbv4Y0ktB+GmWOiwHl237UUOrLmQxLvw== - ieee754@^1.1.13: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"