fix: skip analytics capture calls if workspaceId is undefined
This commit is contained in:
parent
3bbf241720
commit
45214eb743
2 changed files with 8 additions and 1 deletions
|
|
@ -358,6 +358,9 @@ export default async function doLoadConfig(options: {
|
|||
};
|
||||
|
||||
if (newConfig.analytics) {
|
||||
// FIXME before re-enabling TeamAnalytics.setup() populate workspaceId in
|
||||
// controlPlaneProxyInfo to prevent /proxy/analytics/undefined/capture calls
|
||||
// where undefined is :workspaceId
|
||||
// await TeamAnalytics.setup(
|
||||
// newConfig.analytics,
|
||||
// uniqueId,
|
||||
|
|
|
|||
|
|
@ -20,8 +20,12 @@ export default class ContinueProxyAnalyticsProvider
|
|||
event: string,
|
||||
properties: { [key: string]: any },
|
||||
): Promise<void> {
|
||||
if (!this.controlPlaneProxyInfo?.workspaceId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const url = new URL(
|
||||
`proxy/analytics/${this.controlPlaneProxyInfo?.workspaceId}/capture`,
|
||||
`proxy/analytics/${this.controlPlaneProxyInfo.workspaceId}/capture`,
|
||||
this.controlPlaneProxyInfo?.controlPlaneProxyUrl,
|
||||
).toString();
|
||||
void fetch(url, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue