use old service name

This commit is contained in:
bymyself
2025-11-06 23:53:53 -07:00
parent 860afe2c14
commit eb2afed8dd
7 changed files with 6 additions and 47 deletions

View File

@@ -3,7 +3,6 @@ import { computed, watch } from 'vue'
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions' import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
import { t } from '@/i18n' import { t } from '@/i18n'
import { useTelemetryService } from '@/platform/telemetry'
import { useDialogService } from '@/services/dialogService' import { useDialogService } from '@/services/dialogService'
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore' import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
import { useCommandStore } from '@/stores/commandStore' import { useCommandStore } from '@/stores/commandStore'
@@ -129,18 +128,6 @@ export const useCurrentUser = () => {
} }
} }
// Register telemetry hooks
const telemetryService = useTelemetryService()
telemetryService?.registerHooks({
getCurrentUser: () =>
resolvedUserInfo.value
? {
id: resolvedUserInfo.value.id,
tier: 'free' // This will be enhanced when we add subscription data
}
: null
})
return { return {
loading: authStore.loading, loading: authStore.loading,
isLoggedIn, isLoggedIn,

View File

@@ -4,7 +4,6 @@ import { compare, valid } from 'semver'
import { ref } from 'vue' import { ref } from 'vue'
import type { SettingParams } from '@/platform/settings/types' import type { SettingParams } from '@/platform/settings/types'
import { useTelemetryService } from '@/platform/telemetry'
import type { Settings } from '@/schemas/apiSchema' import type { Settings } from '@/schemas/apiSchema'
import { api } from '@/scripts/api' import { api } from '@/scripts/api'
import { app } from '@/scripts/app' import { app } from '@/scripts/app'
@@ -238,21 +237,6 @@ export const useSettingStore = defineStore('setting', () => {
} }
} }
// Register telemetry hooks
const telemetryService = useTelemetryService()
telemetryService?.registerHooks({
getSurveyData: () => {
// Use raw access to settings that may not be in the typed schema
return settingValues.value['onboarding_survey'] || null
},
getFeatureFlags: () => ({
// Use raw access to feature flags that might not be in the schema
darkMode: settingValues.value['Comfy.UseNewMenu'] === 'Top',
betaFeatures: settingValues.value['Comfy.Beta.Enabled'] === true,
advancedMode: settingValues.value['Comfy.Advanced.Mode'] === true
})
})
return { return {
settingValues, settingValues,
settingsById, settingsById,

View File

@@ -29,7 +29,7 @@ let _telemetryService: TelemetryService | null = null
* CRITICAL: This returns null in OSS builds. There is no telemetry service * CRITICAL: This returns null in OSS builds. There is no telemetry service
* for OSS builds and all tracking calls are no-ops. * for OSS builds and all tracking calls are no-ops.
*/ */
export function useTelemetryService(): TelemetryService | null { export function useTelemetry(): TelemetryService | null {
if (_telemetryService === null) { if (_telemetryService === null) {
// Use distribution check for tree-shaking // Use distribution check for tree-shaking
if (isCloud) { if (isCloud) {
@@ -46,10 +46,3 @@ export function useTelemetryService(): TelemetryService | null {
return _telemetryService return _telemetryService
} }
/**
* @deprecated Use useTelemetryService() instead
*/
export function useTelemetry() {
return useTelemetryService()
}

View File

@@ -47,7 +47,6 @@ export abstract class TelemetryProviderBase implements TelemetryProvider {
this.isEnabled = enabled this.isEnabled = enabled
} }
// All abstract methods from TelemetryProvider interface with proper typing
abstract trackAuth(metadata: AuthMetadata): void abstract trackAuth(metadata: AuthMetadata): void
abstract trackUserLoggedIn(): void abstract trackUserLoggedIn(): void
abstract trackSubscription(event: 'modal_opened' | 'subscribe_clicked'): void abstract trackSubscription(event: 'modal_opened' | 'subscribe_clicked'): void

View File

@@ -138,7 +138,6 @@ export class MixpanelTelemetryProvider extends TelemetryProviderBase {
this.trackEvent(TelemetryEvents.API_CREDIT_TOPUP_SUCCEEDED) this.trackEvent(TelemetryEvents.API_CREDIT_TOPUP_SUCCEEDED)
} }
// Credit top-up tracking methods (composition with utility functions)
startTopupTracking(): void { startTopupTracking(): void {
startTopupUtil() startTopupUtil()
} }
@@ -165,14 +164,12 @@ export class MixpanelTelemetryProvider extends TelemetryProviderBase {
? TelemetryEvents.USER_SURVEY_OPENED ? TelemetryEvents.USER_SURVEY_OPENED
: TelemetryEvents.USER_SURVEY_SUBMITTED : TelemetryEvents.USER_SURVEY_SUBMITTED
// Apply normalization to survey responses
const normalizedResponses = responses const normalizedResponses = responses
? normalizeSurveyResponses(responses) ? normalizeSurveyResponses(responses)
: undefined : undefined
this.trackEvent(eventName, normalizedResponses) this.trackEvent(eventName, normalizedResponses)
// If this is a survey submission, also set user properties with normalized data
if (stage === 'submitted' && normalizedResponses && this.mixpanel) { if (stage === 'submitted' && normalizedResponses && this.mixpanel) {
try { try {
this.mixpanel.people.set(normalizedResponses) this.mixpanel.people.set(normalizedResponses)

View File

@@ -25,8 +25,9 @@ import type {
import type { TelemetryHooks } from '../interfaces/TelemetryHooks' import type { TelemetryHooks } from '../interfaces/TelemetryHooks'
/** /**
* Central telemetry service that manages multiple providers and resolves * Central telemetry service that coordinates multiple analytics providers.
* context through hook-based dependency inversion. * Uses registered hooks to gather context data from application stores
* without creating circular import dependencies.
*/ */
export class TelemetryService { export class TelemetryService {
private hooks: TelemetryHooks = {} private hooks: TelemetryHooks = {}
@@ -86,7 +87,6 @@ export class TelemetryService {
subscribe_to_run?: boolean subscribe_to_run?: boolean
trigger_source?: ExecutionTriggerSource trigger_source?: ExecutionTriggerSource
}): void { }): void {
// Resolve complete context through hooks
const context = this.hooks.getExecutionContext?.() const context = this.hooks.getExecutionContext?.()
if (!context) return // Don't track if no context available if (!context) return // Don't track if no context available
@@ -209,7 +209,6 @@ export class TelemetryService {
} }
trackWorkflowExecution(): void { trackWorkflowExecution(): void {
// Resolve context through hooks and only track if context is available
const context = this.hooks.getExecutionContext?.() const context = this.hooks.getExecutionContext?.()
if (!context) return // Don't track if no context available if (!context) return // Don't track if no context available

View File

@@ -9,7 +9,7 @@ import type {
LGraphNode, LGraphNode,
Subgraph Subgraph
} from '@/lib/litegraph/src/litegraph' } from '@/lib/litegraph/src/litegraph'
import { useTelemetryService } from '@/platform/telemetry' import { useTelemetry } from '@/platform/telemetry'
import type { import type {
ComfyWorkflowJSON, ComfyWorkflowJSON,
NodeId NodeId
@@ -714,7 +714,7 @@ export const useWorkflowStore = defineStore('workflow', () => {
} }
// Register telemetry hooks // Register telemetry hooks
const telemetryService = useTelemetryService() const telemetryService = useTelemetry()
telemetryService?.registerHooks({ telemetryService?.registerHooks({
getActiveWorkflow: () => getActiveWorkflow: () =>
activeWorkflow.value activeWorkflow.value