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 { t } from '@/i18n'
import { useTelemetryService } from '@/platform/telemetry'
import { useDialogService } from '@/services/dialogService'
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
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 {
loading: authStore.loading,
isLoggedIn,

View File

@@ -4,7 +4,6 @@ import { compare, valid } from 'semver'
import { ref } from 'vue'
import type { SettingParams } from '@/platform/settings/types'
import { useTelemetryService } from '@/platform/telemetry'
import type { Settings } from '@/schemas/apiSchema'
import { api } from '@/scripts/api'
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 {
settingValues,
settingsById,

View File

@@ -29,7 +29,7 @@ let _telemetryService: TelemetryService | null = null
* CRITICAL: This returns null in OSS builds. There is no telemetry service
* for OSS builds and all tracking calls are no-ops.
*/
export function useTelemetryService(): TelemetryService | null {
export function useTelemetry(): TelemetryService | null {
if (_telemetryService === null) {
// Use distribution check for tree-shaking
if (isCloud) {
@@ -46,10 +46,3 @@ export function useTelemetryService(): TelemetryService | null {
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
}
// All abstract methods from TelemetryProvider interface with proper typing
abstract trackAuth(metadata: AuthMetadata): void
abstract trackUserLoggedIn(): 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)
}
// Credit top-up tracking methods (composition with utility functions)
startTopupTracking(): void {
startTopupUtil()
}
@@ -165,14 +164,12 @@ export class MixpanelTelemetryProvider extends TelemetryProviderBase {
? TelemetryEvents.USER_SURVEY_OPENED
: TelemetryEvents.USER_SURVEY_SUBMITTED
// Apply normalization to survey responses
const normalizedResponses = responses
? normalizeSurveyResponses(responses)
: undefined
this.trackEvent(eventName, normalizedResponses)
// If this is a survey submission, also set user properties with normalized data
if (stage === 'submitted' && normalizedResponses && this.mixpanel) {
try {
this.mixpanel.people.set(normalizedResponses)

View File

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

View File

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