mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
use old service name
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user