Skip to content

Commit 45214eb

Browse files
committed
fix: skip analytics capture calls if workspaceId is undefined
1 parent 3bbf241 commit 45214eb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/config/profile/doLoadConfig.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ export default async function doLoadConfig(options: {
358358
};
359359

360360
if (newConfig.analytics) {
361+
// FIXME before re-enabling TeamAnalytics.setup() populate workspaceId in
362+
// controlPlaneProxyInfo to prevent /proxy/analytics/undefined/capture calls
363+
// where undefined is :workspaceId
361364
// await TeamAnalytics.setup(
362365
// newConfig.analytics,
363366
// uniqueId,

core/control-plane/analytics/ContinueProxyAnalyticsProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ export default class ContinueProxyAnalyticsProvider
2020
event: string,
2121
properties: { [key: string]: any },
2222
): Promise<void> {
23+
if (!this.controlPlaneProxyInfo?.workspaceId) {
24+
return;
25+
}
26+
2327
const url = new URL(
24-
`proxy/analytics/${this.controlPlaneProxyInfo?.workspaceId}/capture`,
28+
`proxy/analytics/${this.controlPlaneProxyInfo.workspaceId}/capture`,
2529
this.controlPlaneProxyInfo?.controlPlaneProxyUrl,
2630
).toString();
2731
void fetch(url, {

0 commit comments

Comments
 (0)