Skip to content

Commit

Permalink
fix(browser): bump remote config package (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Wallach authored Aug 23, 2024
2 parents 1a070ad + d0a2a20 commit 82d6e06
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 42 deletions.
2 changes: 1 addition & 1 deletion packages/analytics-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 0 additions & 6 deletions packages/analytics-browser/src/config/joined-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
25 changes: 0 additions & 25 deletions packages/analytics-browser/test/config/joined-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof createRemoteConfigFetch>).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);
});
});
});

Expand Down
14 changes: 4 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 82d6e06

Please sign in to comment.