Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Nov 26, 2025

Summary

Adds abiltiy to toggle events on/off by name from dynamic feature flags. Also makes some events disabled by default (not being used for any analysis and taking too much of event quota currently).

Note: telemetry is only enabled on cloud - this doesn't affect local users in any way.

┆Issue is synchronized with this Notion page by Unito

@christian-byrne christian-byrne requested a review from a team as a code owner November 26, 2025 01:15
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 26, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

📝 Walkthrough

Walkthrough

The changes add support for dynamically disabling telemetry events through remote configuration. The RemoteConfig type now includes an optional telemetry_disabled_events property listing event names to suppress. The MixpanelTelemetryProvider implements internal mechanisms to read this configuration, validate event names, maintain a disabled events set with automatic reconfiguration on remote config changes, and skip tracking of disabled events.

Changes

Cohort / File(s) Change Summary
Remote Config Type Updates
src/platform/remoteConfig/types.ts
Adds TelemetryEventName import and extends RemoteConfig type with optional telemetry_disabled_events property of type TelemetryEventName[]
Telemetry Provider Event Filtering
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
Implements dynamic event disabling by introducing DEFAULT_DISABLED_EVENTS constant, TELEMETRY_EVENT_SET validator, private disabledEvents set initialized from remote config, configureDisabledEvents and buildEventSet methods to produce validated event sets, integrates disable checks in trackEvent to skip queued events, and adds watchers for remote config changes

Sequence Diagram(s)

sequenceDiagram
    participant rc as Remote Config
    participant mtp as MixpanelTelemetryProvider
    participant mp as Mixpanel
    
    Note over mtp: Initialization
    mtp->>rc: Get telemetry_disabled_events
    mtp->>mtp: buildEventSet(events)
    mtp->>mtp: Store in disabledEvents set
    rc-->>mtp: Watch for changes
    
    Note over mtp: Event Tracking
    mtp->>mtp: trackEvent(eventName)
    alt Event is disabled?
        mtp->>mtp: Skip tracking
    else Event is enabled
        mtp->>mp: Queue/track event
    end
    
    Note over rc: Config Updated
    rc->>mtp: Notify change
    mtp->>rc: Get updated telemetry_disabled_events
    mtp->>mtp: Reconfigure disabledEvents set
Loading
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cloud/lower-telemetry

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 26, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 11/26/2025, 01:17:29 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Nov 26, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 11/26/2025, 01:25:57 AM UTC

📈 Summary

  • Total Tests: 497
  • Passed: 486 ✅
  • Failed: 0
  • Flaky: 2 ⚠️
  • Skipped: 9 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 477 / ❌ 0 / ⚠️ 2 / ⏭️ 9
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 6 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@christian-byrne christian-byrne added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch cloud/1.32 labels Nov 26, 2025
@github-actions
Copy link

Bundle Size Report

Summary

  • Raw size: 17 MB baseline 17 MB — 🔴 +2.36 kB
  • Gzip: 3.37 MB baseline 3.36 MB — 🔴 +961 B
  • Brotli: 2.58 MB baseline 2.58 MB — 🔴 +434 B
  • Bundles: 93 current • 93 baseline • 38 added / 38 removed

Category Glance
App Entry Points 🔴 +2.36 kB (3.18 MB) · Vendor & Third-Party ⚪ 0 B (8.56 MB) · Other ⚪ 0 B (3.84 MB) · Graph Workspace ⚪ 0 B (944 kB) · Panels & Settings ⚪ 0 B (298 kB) · UI Components ⚪ 0 B (139 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.18 MB (baseline 3.18 MB) • 🔴 +2.36 kB

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-CCLrMwJM.js (new) 2.95 MB 🔴 +2.95 MB 🔴 +615 kB 🔴 +467 kB
assets/index-D48FzoB6.js (removed) 2.95 MB 🟢 -2.95 MB 🟢 -614 kB 🟢 -467 kB
assets/index-D97MIfjn.js (new) 227 kB 🔴 +227 kB 🔴 +48.6 kB 🔴 +40 kB
assets/index-sX64gFEr.js (removed) 227 kB 🟢 -227 kB 🟢 -48.6 kB 🟢 -40 kB
assets/index-BM0C4AnK.js (new) 345 B 🔴 +345 B 🔴 +245 B 🔴 +236 B
assets/index-CdpN812c.js (removed) 345 B 🟢 -345 B 🟢 -246 B 🟢 -237 B

Status: 3 added / 3 removed

Graph Workspace — 944 kB (baseline 944 kB) • ⚪ 0 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-BXR7Si6d.js (new) 944 kB 🔴 +944 kB 🔴 +183 kB 🔴 +140 kB
assets/GraphView-G_Ht0XUL.js (removed) 944 kB 🟢 -944 kB 🟢 -183 kB 🟢 -140 kB

Status: 1 added / 1 removed

Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-B_3TUNaE.js (removed) 6.54 kB 🟢 -6.54 kB 🟢 -2.14 kB 🟢 -1.89 kB
assets/UserSelectView-DAhYIZA1.js (new) 6.54 kB 🔴 +6.54 kB 🔴 +2.14 kB 🔴 +1.9 kB

Status: 1 added / 1 removed

Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/CreditsPanel-DqV1bE5x.js (new) 21.4 kB 🔴 +21.4 kB 🔴 +5.15 kB 🔴 +4.5 kB
assets/CreditsPanel-Ta8OaIni.js (removed) 21.4 kB 🟢 -21.4 kB 🟢 -5.15 kB 🟢 -4.5 kB
assets/KeybindingPanel-Bj2LJ1PD.js (new) 13.6 kB 🔴 +13.6 kB 🔴 +3.42 kB 🔴 +3.01 kB
assets/KeybindingPanel-NgrgAmAp.js (removed) 13.6 kB 🟢 -13.6 kB 🟢 -3.42 kB 🟢 -3.01 kB
assets/ExtensionPanel-DzKUFrXu.js (removed) 10.4 kB 🟢 -10.4 kB 🟢 -2.48 kB 🟢 -2.17 kB
assets/ExtensionPanel-mgxFhtBV.js (new) 10.4 kB 🔴 +10.4 kB 🔴 +2.48 kB 🔴 +2.17 kB
assets/AboutPanel-9pDwLy7Z.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.21 kB
assets/AboutPanel-wruquhw6.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/ServerConfigPanel-BpZEpbuc.js (removed) 6.56 kB 🟢 -6.56 kB 🟢 -1.83 kB 🟢 -1.63 kB
assets/ServerConfigPanel-CTpA5ZcC.js (new) 6.56 kB 🔴 +6.56 kB 🔴 +1.83 kB 🔴 +1.63 kB
assets/UserPanel-DDbFAXfu.js (removed) 6.23 kB 🟢 -6.23 kB 🟢 -1.72 kB 🟢 -1.51 kB
assets/UserPanel-fOw8Vq66.js (new) 6.23 kB 🔴 +6.23 kB 🔴 +1.72 kB 🔴 +1.51 kB
assets/settings-BXTtSH4O.js 33.3 kB 33.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C9Pzn-NG.js 25.2 kB 25.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CCy2fA_h.js 27.3 kB 27.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CQpqEFfl.js 26.6 kB 26.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DHcnxypw.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DhFTK9fY.js 25.1 kB 25.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DlT4t_ui.js 25.9 kB 25.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DRgSrIdD.js 24.2 kB 24.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-tjkeqiZq.js 21.1 kB 21.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 139 kB (baseline 139 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/Load3D.vue_vue_type_script_setup_true_lang-CIgHTime.js (new) 53.9 kB 🔴 +53.9 kB 🔴 +8.52 kB 🔴 +7.32 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-CL6gZJ6S.js (removed) 53.9 kB 🟢 -53.9 kB 🟢 -8.52 kB 🟢 -7.32 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-BvmiP2Oc.js (new) 46.9 kB 🔴 +46.9 kB 🔴 +10.1 kB 🔴 +8.77 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-Deplz3gP.js (removed) 46.9 kB 🟢 -46.9 kB 🟢 -10.1 kB 🟢 -8.77 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-CBjDIEOk.js (removed) 12.8 kB 🟢 -12.8 kB 🟢 -3.35 kB 🟢 -2.96 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-DaFqCFHJ.js (new) 12.8 kB 🔴 +12.8 kB 🔴 +3.35 kB 🔴 +2.96 kB
assets/ComfyQueueButton-B-ce0tOv.js (removed) 7.73 kB 🟢 -7.73 kB 🟢 -2.2 kB 🟢 -1.95 kB
assets/ComfyQueueButton-W0ddHcbB.js (new) 7.73 kB 🔴 +7.73 kB 🔴 +2.2 kB 🔴 +1.96 kB
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-Bre8WloN.js (removed) 2.16 kB 🟢 -2.16 kB 🟢 -825 B 🟢 -721 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-CyvSINgg.js (new) 2.16 kB 🔴 +2.16 kB 🔴 +826 B 🔴 +715 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-32tpDTLG.js (new) 897 B 🔴 +897 B 🔴 +503 B 🔴 +436 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-bnTYXX18.js (removed) 897 B 🟢 -897 B 🟢 -505 B 🟢 -463 B
assets/LazyImage.vue_vue_type_script_setup_true_lang-DNzEEbAp.js 10.8 kB 10.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-B4qnwhJi.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-0Kc6B4DO.js 2.04 kB 2.04 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-B2EwpY0K.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.84 kB 🟢 -1.58 kB
assets/keybindingService-CEw4vw2F.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.84 kB 🔴 +1.58 kB
assets/audioService-CR6et39d.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +962 B 🔴 +829 B
assets/audioService-DvB3-2c3.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -962 B 🟢 -831 B
assets/serverConfigStore-NS6ibDz2.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 2 added / 2 removed

Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-B5QjpRdi.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +649 B 🔴 +543 B
assets/audioUtils-CmH0-__r.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -650 B 🟢 -544 B
assets/mathUtil-CTARWQ-l.js 1.07 kB 1.07 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeFilterUtil-CXKCRJ-m.js 460 B 460 B ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 1 added / 1 removed

Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-Bc7F9itp.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-BUi7FCLE.js 3.98 MB 3.98 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-DTsA3ueY.js 1.96 MB 1.96 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-aR6ntw5X.js 1.37 MB 1.37 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-CaFtSsrn.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-xOQVyCMJ.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BZLod3g9.js 407 kB 407 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/WidgetRecordAudio-CeGKU-fp.js (new) 20.5 kB 🔴 +20.5 kB 🔴 +5.25 kB 🔴 +4.66 kB
assets/WidgetRecordAudio-DUM733ta.js (removed) 20.5 kB 🟢 -20.5 kB 🟢 -5.25 kB 🟢 -4.64 kB
assets/AudioPreviewPlayer-DFhOqfm8.js (removed) 13.6 kB 🟢 -13.6 kB 🟢 -3.42 kB 🟢 -3.08 kB
assets/AudioPreviewPlayer-DgeogEJ8.js (new) 13.6 kB 🔴 +13.6 kB 🔴 +3.42 kB 🔴 +3.07 kB
assets/WidgetGalleria-BwH5YfAu.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.45 kB 🟢 -1.31 kB
assets/WidgetGalleria-VPscl29T.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.45 kB 🔴 +1.31 kB
assets/WidgetColorPicker-D6IQP08C.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.23 kB
assets/WidgetColorPicker-WNKTB2tH.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.23 kB
assets/WidgetMarkdown-CqdpyyuU.js (new) 3.16 kB 🔴 +3.16 kB 🔴 +1.31 kB 🔴 +1.16 kB
assets/WidgetMarkdown-CWineY58.js (removed) 3.16 kB 🟢 -3.16 kB 🟢 -1.31 kB 🟢 -1.16 kB
assets/WidgetAudioUI-CB8D07W5.js (removed) 2.82 kB 🟢 -2.82 kB 🟢 -1.12 kB 🟢 -1.02 kB
assets/WidgetAudioUI-D7ZR_UKD.js (new) 2.82 kB 🔴 +2.82 kB 🔴 +1.12 kB 🔴 +1.04 kB
assets/WidgetTextarea-B-y0XCV_.js (new) 2.54 kB 🔴 +2.54 kB 🔴 +1.04 kB 🔴 +927 B
assets/WidgetTextarea-J8IxDnwC.js (removed) 2.54 kB 🟢 -2.54 kB 🟢 -1.04 kB 🟢 -911 B
assets/WidgetInputText-DnSaOdiu.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +916 B 🔴 +851 B
assets/WidgetInputText-jVONytVY.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -916 B 🟢 -848 B
assets/WidgetToggleSwitch-8t4KMWrJ.js (new) 1.76 kB 🔴 +1.76 kB 🔴 +833 B 🔴 +730 B
assets/WidgetToggleSwitch-C4CwjhXJ.js (removed) 1.76 kB 🟢 -1.76 kB 🟢 -833 B 🟢 -730 B
assets/MediaImageBottom-BOKoE8Wh.js (removed) 1.57 kB 🟢 -1.57 kB 🟢 -742 B 🟢 -645 B
assets/MediaImageBottom-tMQg16Yv.js (new) 1.57 kB 🔴 +1.57 kB 🔴 +742 B 🔴 +644 B
assets/MediaAudioBottom-CQk2S9GT.js (new) 1.52 kB 🔴 +1.52 kB 🔴 +741 B 🔴 +659 B
assets/MediaAudioBottom-DJuRPZf6.js (removed) 1.52 kB 🟢 -1.52 kB 🟢 -740 B 🟢 -658 B
assets/MediaVideoBottom-D7r8cXaH.js (new) 1.52 kB 🔴 +1.52 kB 🔴 +739 B 🔴 +655 B
assets/MediaVideoBottom-DKgJzO9w.js (removed) 1.52 kB 🟢 -1.52 kB 🟢 -741 B 🟢 -656 B
assets/Media3DBottom-5EwJUO56.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -731 B 🟢 -649 B
assets/Media3DBottom-BCrPXOhW.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +731 B 🔴 +652 B
assets/Media3DTop-BHlNzvo_.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +765 B 🔴 +647 B
assets/Media3DTop-t2Pi2aET.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -766 B 🟢 -656 B
assets/WidgetSelect-BB7Ima-V.js (new) 655 B 🔴 +655 B 🔴 +343 B 🔴 +291 B
assets/WidgetSelect-BC8dqw-l.js (removed) 655 B 🟢 -655 B 🟢 -342 B 🟢 -289 B
assets/WidgetInputNumber-C-wFenJk.js (new) 595 B 🔴 +595 B 🔴 +329 B 🔴 +277 B
assets/WidgetInputNumber-DYsT0stF.js (removed) 595 B 🟢 -595 B 🟢 -330 B 🟢 -278 B
assets/Load3D-90CO4mEz.js (new) 424 B 🔴 +424 B 🔴 +267 B 🔴 +224 B
assets/Load3D-CyDtunBD.js (removed) 424 B 🟢 -424 B 🟢 -267 B 🟢 -223 B
assets/WidgetLegacy-Bg8RJXSn.js (removed) 364 B 🟢 -364 B 🟢 -237 B 🟢 -193 B
assets/WidgetLegacy-Cgn8aGa2.js (new) 364 B 🔴 +364 B 🔴 +236 B 🔴 +195 B
assets/commands-_s-RvhJR.js 13.6 kB 13.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BuUILW6P.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BV4R6fLx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CLwPdnT6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CWMchBmd.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DazTQhtc.js 12.9 kB 12.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DmWrOe93.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwiH7Kr6.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-mS3LCNPn.js 14.5 kB 14.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-5lOBdqcC.js 84.5 kB 84.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BOCuaVpE.js 73.4 kB 73.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-ClrEFGUz.js 72.4 kB 72.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CyNU0iQX.js 99.3 kB 99.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-D7gwLxft.js 114 kB 114 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DC8o4BCt.js 86.8 kB 86.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DKiesCV4.js 94.3 kB 94.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Hq2q-OtB.js 83.6 kB 83.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-USAlAlnj.js 82 kB 82 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-ClVHGsSJ.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-BTxsJ9KT.js 1.68 kB 1.68 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-P2MYHlgs.js 2.76 kB 2.76 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-_Px5dSNW.js 306 kB 306 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-7z21KPoS.js 285 kB 285 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BWKZzBPK.js 346 kB 346 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CGbgH4Yl.js 320 kB 320 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CjjjdWkV.js 313 kB 313 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CVrNtxvj.js 288 kB 288 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DLRSA0IK.js 309 kB 309 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DQV2gnwA.js 372 kB 372 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-ofqLG5vz.js 310 kB 310 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-DaKVD7Py.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-DE5-CeXh.js 2.21 kB 2.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 18 added / 18 removed

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts (1)

140-152: Queued events bypass the disabled check.

Events queued before Mixpanel initializes (or before remote config loads) will be tracked in flushEventQueue without checking disabledEvents. If an event becomes disabled via remote config after being queued but before flush, it will still be sent.

Consider filtering disabled events during flush:

 private flushEventQueue(): void {
   if (!this.isInitialized || !this.mixpanel) {
     return
   }

   while (this.eventQueue.length > 0) {
     const event = this.eventQueue.shift()!
+    if (this.disabledEvents.has(event.eventName)) {
+      continue
+    }
     try {
       this.mixpanel.track(event.eventName, event.properties || {})
     } catch (error) {
       console.error('Failed to track queued event:', error)
     }
   }
 }
🧹 Nitpick comments (2)
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts (2)

189-197: Consider a more idiomatic implementation.

The buildEventSet method can be simplified using filter for better readability.

 private buildEventSet(values: TelemetryEventName[]): Set<TelemetryEventName> {
-  const normalized = new Set<TelemetryEventName>()
-  values.forEach((value) => {
-    if (TELEMETRY_EVENT_SET.has(value)) {
-      normalized.add(value)
-    }
-  })
-  return normalized
+  return new Set(values.filter((value) => TELEMETRY_EVENT_SET.has(value)))
 }

182-187: Silent filtering of invalid event names may complicate debugging.

When buildEventSet filters out invalid event names from remote config, there's no logging to indicate that an unrecognized event name was provided. This could make misconfiguration harder to diagnose.

Consider adding a dev-only warning:

 private buildEventSet(values: TelemetryEventName[]): Set<TelemetryEventName> {
-  const normalized = new Set<TelemetryEventName>()
-  values.forEach((value) => {
-    if (TELEMETRY_EVENT_SET.has(value)) {
-      normalized.add(value)
+  return new Set(
+    values.filter((value) => {
+      const isValid = TELEMETRY_EVENT_SET.has(value)
+      if (!isValid && import.meta.env.DEV) {
+        console.warn(`Unknown telemetry event name in disabled list: ${value}`)
+      }
+      return isValid
+    })
+  )
-    }
-  })
-  return normalized
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ff3a0e and 794d498.

📒 Files selected for processing (2)
  • src/platform/remoteConfig/types.ts (2 hunks)
  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
  • src/platform/remoteConfig/types.ts
🧠 Learnings (6)
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.vue : Use watch and watchEffect for side effects in Vue 3

Applied to files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{vue,ts,tsx} : Leverage VueUse functions for performance-enhancing utilities

Applied to files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Use watch and watchEffect for side effects

Applied to files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use useIntersectionObserver for visibility detection instead of custom scroll handlers

Applied to files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners

Applied to files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Leverage VueUse functions for performance-enhancing styles

Applied to files:

  • src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts
🧬 Code graph analysis (1)
src/platform/remoteConfig/types.ts (1)
src/platform/telemetry/types.ts (1)
  • TelemetryEventName (404-405)
🪛 ESLint
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts

[error] 2-2: Unable to resolve path to module 'vue'.

(import-x/no-unresolved)


[error] 45-45: Unable to resolve path to module '@/platform/remoteConfig/remoteConfig'.

(import-x/no-unresolved)


[error] 47-47: Unable to resolve path to module '../../types'.

(import-x/no-unresolved)


[error] 48-48: Unable to resolve path to module '../../utils/surveyNormalization'.

(import-x/no-unresolved)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: deploy-and-comment
  • GitHub Check: test
  • GitHub Check: setup
  • GitHub Check: lint-and-format
  • GitHub Check: collect
🔇 Additional comments (3)
src/platform/remoteConfig/types.ts (1)

36-36: LGTM!

The new optional property correctly types the disabled events list using TelemetryEventName[], enabling type-safe configuration of disabled telemetry events.

src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts (2)

50-67: LGTM!

Good approach defining defaults and a validation set. The TELEMETRY_EVENT_SET enables O(1) validation of event names from remote config, preventing invalid event names from being added to the disabled set.


163-165: LGTM!

Clean early return pattern for disabled events. This prevents both immediate tracking and queuing of disabled events.

Comment on lines +95 to +100
this.configureDisabledEvents(
(window.__CONFIG__ as Partial<RemoteConfig> | undefined) ?? null
)
watch(remoteConfig, (config) => {
this.configureDisabledEvents(config)
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Script executed:

#!/bin/bash
# Find remoteConfig declaration and understand its nature
rg -n -B3 -A3 'export (const|let) remoteConfig' --type ts

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

src/platform/remoteConfig/remoteConfig.ts-19- * Reactive remote configuration
src/platform/remoteConfig/remoteConfig.ts-20- * Updated whenever config is loaded from the server
src/platform/remoteConfig/remoteConfig.ts-21- */
src/platform/remoteConfig/remoteConfig.ts:22:export const remoteConfig = ref<RemoteConfig>({})
src/platform/remoteConfig/remoteConfig.ts-23-
src/platform/remoteConfig/remoteConfig.ts-24-export function configValueOrDefault<K extends keyof RemoteConfig>(
src/platform/remoteConfig/remoteConfig.ts-25-  remoteConfig: RemoteConfig,

</shell_result>


Script executed:

#!/bin/bash
# Find where remoteConfig is updated/populated
rg -n 'remoteConfig\.value\s*=' --type ts

# Also check the constructor context in MixpanelTelemetryProvider
rg -n -B10 -A15 'configureDisabledEvents' src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts | head -60

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

src/platform/remoteConfig/remoteConfig.ts:43:      remoteConfig.value = config
src/platform/remoteConfig/remoteConfig.ts:47:      remoteConfig.value = {}
src/platform/remoteConfig/remoteConfig.ts:52:    remoteConfig.value = {}
85- */
86-export class MixpanelTelemetryProvider implements TelemetryProvider {
87-  private isEnabled = true
88-  private mixpanel: OverridedMixpanel | null = null
89-  private eventQueue: QueuedEvent[] = []
90-  private isInitialized = false
91-  private lastTriggerSource: ExecutionTriggerSource | undefined
92-  private disabledEvents = new Set<TelemetryEventName>(DEFAULT_DISABLED_EVENTS)
93-
94-  constructor() {
95:    this.configureDisabledEvents(
96-      (window.__CONFIG__ as Partial<RemoteConfig> | undefined) ?? null
97-    )
98-    watch(remoteConfig, (config) => {
99:      this.configureDisabledEvents(config)
100-    })
101-    const token = window.__CONFIG__?.mixpanel_token
102-
103-    if (token) {
104-      try {
105-        // Dynamic import to avoid bundling mixpanel in OSS builds
106-        void import('mixpanel-browser')
107-          .then((mixpanelModule) => {
108-            this.mixpanel = mixpanelModule.default
109-            this.mixpanel.init(token, {
110-              debug: import.meta.env.DEV,
111-              track_pageview: true,
112-              api_host: 'https://mp.comfy.org',
113-              cross_subdomain_cookie: true,
114-              persistence: 'cookie',
--
172-        this.mixpanel.track(eventName, properties || {})
173-      } catch (error) {
174-        console.error('Failed to track event:', error)
175-      }
176-    } else {
177-      // Mixpanel not ready yet, queue the event
178-      this.eventQueue.push(event)
179-    }
180-  }
181-
182:  private configureDisabledEvents(config: Partial<RemoteConfig> | null): void {
183-    const disabledSource =
184-      config?.telemetry_disabled_events ?? DEFAULT_DISABLED_EVENTS
185-
186-    this.disabledEvents = this.buildEventSet(disabledSource)
187-  }
188-
189-  private buildEventSet(values: TelemetryEventName[]): Set<TelemetryEventName> {
190-    const normalized = new Set<TelemetryEventName>()
191-    values.forEach((value) => {
192-      if (TELEMETRY_EVENT_SET.has(value)) {
193-        normalized.add(value)
194-      }
195-    })
196-    return normalized
197-  }

</shell_result>


Script executed:

#!/bin/bash
# Find where remoteConfig is populated (the actual assignment with config)
rg -n -B5 'remoteConfig\.value = config' --type ts

# Check when/how MixpanelTelemetryProvider is instantiated
rg -n 'new MixpanelTelemetryProvider\|MixpanelTelemetryProvider()' --type ts

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 1

stdout:

src/platform/remoteConfig/remoteConfig.ts-38-  try {
src/platform/remoteConfig/remoteConfig.ts-39-    const response = await fetch('/api/features', { cache: 'no-store' })
src/platform/remoteConfig/remoteConfig.ts-40-    if (response.ok) {
src/platform/remoteConfig/remoteConfig.ts-41-      const config = await response.json()
src/platform/remoteConfig/remoteConfig.ts-42-      window.__CONFIG__ = config
src/platform/remoteConfig/remoteConfig.ts:43:      remoteConfig.value = config

</shell_result>


Script executed:

#!/bin/bash
# Search for MixpanelTelemetryProvider usage/instantiation
rg -n 'MixpanelTelemetryProvider' --type ts -B2 -A2

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

src/platform/telemetry/index.ts-17-import { isCloud } from '@/platform/distribution/types'
src/platform/telemetry/index.ts-18-
src/platform/telemetry/index.ts:19:import { MixpanelTelemetryProvider } from './providers/cloud/MixpanelTelemetryProvider'
src/platform/telemetry/index.ts-20-import type { TelemetryProvider } from './types'
src/platform/telemetry/index.ts-21-
--
src/platform/telemetry/index.ts-34-    // Use distribution check for tree-shaking
src/platform/telemetry/index.ts-35-    if (isCloud) {
src/platform/telemetry/index.ts:36:      _telemetryProvider = new MixpanelTelemetryProvider()
src/platform/telemetry/index.ts-37-    }
src/platform/telemetry/index.ts-38-    // For OSS builds, _telemetryProvider stays null
--
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-84- * 3. Check dist/assets/*.js files contain no tracking code
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-85- */
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts:86:export class MixpanelTelemetryProvider implements TelemetryProvider {
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-87-  private isEnabled = true
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-88-  private mixpanel: OverridedMixpanel | null = null

</shell_result>


Script executed:

#!/bin/bash
# View the telemetry index to understand initialization timing
cat -n src/platform/telemetry/index.ts | head -50

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

     1	/**
     2	 * Telemetry Provider - OSS Build Safety
     3	 *
     4	 * CRITICAL: OSS Build Safety
     5	 * This module is conditionally compiled based on distribution. When building
     6	 * the open source version (DISTRIBUTION unset), this entire module and its dependencies
     7	 * are excluded through via tree-shaking.
     8	 *
     9	 * To verify OSS builds exclude this code:
    10	 * 1. `DISTRIBUTION= pnpm build` (OSS build)
    11	 * 2. `grep -RinE --include='*.js' 'trackWorkflow|trackEvent|mixpanel' dist/` (should find nothing)
    12	 * 3. Check dist/assets/*.js files contain no tracking code
    13	 *
    14	 * This approach maintains complete separation between cloud and OSS builds
    15	 * while ensuring the open source version contains no telemetry dependencies.
    16	 */
    17	import { isCloud } from '@/platform/distribution/types'
    18	
    19	import { MixpanelTelemetryProvider } from './providers/cloud/MixpanelTelemetryProvider'
    20	import type { TelemetryProvider } from './types'
    21	
    22	// Singleton instance
    23	let _telemetryProvider: TelemetryProvider | null = null
    24	
    25	/**
    26	 * Telemetry factory - conditionally creates provider based on distribution
    27	 * Returns singleton instance.
    28	 *
    29	 * CRITICAL: This returns undefined in OSS builds. There is no telemetry provider
    30	 * for OSS builds and all tracking calls are no-ops.
    31	 */
    32	export function useTelemetry(): TelemetryProvider | null {
    33	  if (_telemetryProvider === null) {
    34	    // Use distribution check for tree-shaking
    35	    if (isCloud) {
    36	      _telemetryProvider = new MixpanelTelemetryProvider()
    37	    }
    38	    // For OSS builds, _telemetryProvider stays null
    39	  }
    40	
    41	  return _telemetryProvider
    42	}

</shell_result>


Script executed:

#!/bin/bash
# Find when remoteConfig fetch is initiated
rg -n 'loadRemoteConfig\|/api/features' --type ts -B3 -A3

# Find first calls to useTelemetry
rg -n 'useTelemetry()' --type ts -B2 -A2

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

src/composables/useWorkflowTemplateSelectorDialog.ts-1-import WorkflowTemplateSelectorDialog from '@/components/custom/widget/WorkflowTemplateSelectorDialog.vue'
src/composables/useWorkflowTemplateSelectorDialog.ts:2:import { useTelemetry } from '@/platform/telemetry'
src/composables/useWorkflowTemplateSelectorDialog.ts-3-import { useDialogService } from '@/services/dialogService'
src/composables/useWorkflowTemplateSelectorDialog.ts-4-import { useDialogStore } from '@/stores/dialogStore'
--
src/composables/useWorkflowTemplateSelectorDialog.ts-15-
src/composables/useWorkflowTemplateSelectorDialog.ts-16-  function show(source: 'sidebar' | 'menu' | 'command' = 'command') {
src/composables/useWorkflowTemplateSelectorDialog.ts:17:    useTelemetry()?.trackTemplateLibraryOpened({ source })
src/composables/useWorkflowTemplateSelectorDialog.ts-18-
src/composables/useWorkflowTemplateSelectorDialog.ts-19-    dialogService.showLayoutDialog({
--
src/composables/useCoreCommands.ts-24-import { useSettingStore } from '@/platform/settings/settingStore'
src/composables/useCoreCommands.ts-25-import { buildSupportUrl } from '@/platform/support/config'
src/composables/useCoreCommands.ts:26:import { useTelemetry } from '@/platform/telemetry'
src/composables/useCoreCommands.ts-27-import type { ExecutionTriggerSource } from '@/platform/telemetry/types'
src/composables/useCoreCommands.ts-28-import { useToastStore } from '@/platform/updates/common/toastStore'
--
src/composables/useCoreCommands.ts-77-  const canvasStore = useCanvasStore()
src/composables/useCoreCommands.ts-78-  const executionStore = useExecutionStore()
src/composables/useCoreCommands.ts:79:  const telemetry = useTelemetry()
src/composables/useCoreCommands.ts-80-  const { staticUrls, buildDocsUrl } = useExternalLink()
src/composables/useCoreCommands.ts-81-
--
src/composables/useCoreCommands.ts-475-        trigger_source?: ExecutionTriggerSource
src/composables/useCoreCommands.ts-476-      }) => {
src/composables/useCoreCommands.ts:477:        useTelemetry()?.trackRunButton(metadata)
src/composables/useCoreCommands.ts-478-        if (!isActiveSubscription.value) {
src/composables/useCoreCommands.ts-479-          showSubscriptionDialog()
--
src/composables/useCoreCommands.ts-483-        const batchCount = useQueueSettingsStore().batchCount
src/composables/useCoreCommands.ts-484-
src/composables/useCoreCommands.ts:485:        useTelemetry()?.trackWorkflowExecution()
src/composables/useCoreCommands.ts-486-
src/composables/useCoreCommands.ts-487-        await app.queuePrompt(0, batchCount)
--
src/composables/useCoreCommands.ts-498-        trigger_source?: ExecutionTriggerSource
src/composables/useCoreCommands.ts-499-      }) => {
src/composables/useCoreCommands.ts:500:        useTelemetry()?.trackRunButton(metadata)
src/composables/useCoreCommands.ts-501-        if (!isActiveSubscription.value) {
src/composables/useCoreCommands.ts-502-          showSubscriptionDialog()
--
src/composables/useCoreCommands.ts-506-        const batchCount = useQueueSettingsStore().batchCount
src/composables/useCoreCommands.ts-507-
src/composables/useCoreCommands.ts:508:        useTelemetry()?.trackWorkflowExecution()
src/composables/useCoreCommands.ts-509-
src/composables/useCoreCommands.ts-510-        await app.queuePrompt(-1, batchCount)
--
src/composables/useCoreCommands.ts-520-        trigger_source?: ExecutionTriggerSource
src/composables/useCoreCommands.ts-521-      }) => {
src/composables/useCoreCommands.ts:522:        useTelemetry()?.trackRunButton(metadata)
src/composables/useCoreCommands.ts-523-        if (!isActiveSubscription.value) {
src/composables/useCoreCommands.ts-524-          showSubscriptionDialog()
--
src/composables/useCoreCommands.ts-553-          return
src/composables/useCoreCommands.ts-554-        }
src/composables/useCoreCommands.ts:555:        useTelemetry()?.trackWorkflowExecution()
src/composables/useCoreCommands.ts-556-        await app.queuePrompt(0, batchCount, executionIds)
src/composables/useCoreCommands.ts-557-      }
--
src/composables/useTemplateFiltering.ts-5-
src/composables/useTemplateFiltering.ts-6-import { useSettingStore } from '@/platform/settings/settingStore'
src/composables/useTemplateFiltering.ts:7:import { useTelemetry } from '@/platform/telemetry'
src/composables/useTemplateFiltering.ts-8-import type { TemplateInfo } from '@/platform/workflow/templates/types/template'
src/composables/useTemplateFiltering.ts-9-import { debounce } from 'es-toolkit/compat'
--
src/composables/useTemplateFiltering.ts-227-  // Template filter tracking (debounced to avoid excessive events)
src/composables/useTemplateFiltering.ts-228-  const debouncedTrackFilterChange = debounce(() => {
src/composables/useTemplateFiltering.ts:229:    useTelemetry()?.trackTemplateFilterChanged({
src/composables/useTemplateFiltering.ts-230-      search_query: searchQuery.value || undefined,
src/composables/useTemplateFiltering.ts-231-      selected_models: selectedModels.value,
--
src/composables/auth/useFirebaseAuthActions.ts-8-import { isCloud } from '@/platform/distribution/types'
src/composables/auth/useFirebaseAuthActions.ts-9-import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
src/composables/auth/useFirebaseAuthActions.ts:10:import { useTelemetry } from '@/platform/telemetry'
src/composables/auth/useFirebaseAuthActions.ts-11-import { useToastStore } from '@/platform/updates/common/toastStore'
src/composables/auth/useFirebaseAuthActions.ts-12-import { useDialogService } from '@/services/dialogService'
--
src/composables/auth/useFirebaseAuthActions.ts-99-    }
src/composables/auth/useFirebaseAuthActions.ts-100-
src/composables/auth/useFirebaseAuthActions.ts:101:    useTelemetry()?.startTopupTracking()
src/composables/auth/useFirebaseAuthActions.ts-102-    window.open(response.checkout_url, '_blank')
src/composables/auth/useFirebaseAuthActions.ts-103-  }, reportError)
--
src/scripts/ui.ts-4-import { useDialogService } from '@/services/dialogService'
src/scripts/ui.ts-5-import { isCloud } from '@/platform/distribution/types'
src/scripts/ui.ts:6:import { useTelemetry } from '@/platform/telemetry'
src/scripts/ui.ts-7-import { useLitegraphService } from '@/services/litegraphService'
src/scripts/ui.ts-8-import { useCommandStore } from '@/stores/commandStore'
--
src/scripts/ui.ts-477-          onclick: () => {
src/scripts/ui.ts-478-            if (isCloud) {
src/scripts/ui.ts:479:              useTelemetry()?.trackRunButton({ trigger_source: 'legacy_ui' })
src/scripts/ui.ts:480:              useTelemetry()?.trackWorkflowExecution()
src/scripts/ui.ts-481-            }
src/scripts/ui.ts-482-            app.queuePrompt(0, this.batchCount)
--
src/scripts/ui.ts-585-            onclick: () => {
src/scripts/ui.ts-586-              if (isCloud) {
src/scripts/ui.ts:587:                useTelemetry()?.trackRunButton({ trigger_source: 'legacy_ui' })
src/scripts/ui.ts:588:                useTelemetry()?.trackWorkflowExecution()
src/scripts/ui.ts-589-              }
src/scripts/ui.ts-590-              app.queuePrompt(-1, this.batchCount)
--
src/services/dialogService.ts-16-import SettingDialogHeader from '@/components/dialog/header/SettingDialogHeader.vue'
src/services/dialogService.ts-17-import { t } from '@/i18n'
src/services/dialogService.ts:18:import { useTelemetry } from '@/platform/telemetry'
src/services/dialogService.ts-19-import { isCloud } from '@/platform/distribution/types'
src/services/dialogService.ts-20-import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
--
src/services/dialogService.ts-133-      dialogComponentProps: {
src/services/dialogService.ts-134-        onClose: () => {
src/services/dialogService.ts:135:          useTelemetry()?.trackUiButtonClicked({
src/services/dialogService.ts-136-            button_id: 'error_dialog_closed'
src/services/dialogService.ts-137-          })
--
src/services/dialogService.ts-222-      dialogComponentProps: {
src/services/dialogService.ts-223-        onClose: () => {
src/services/dialogService.ts:224:          useTelemetry()?.trackUiButtonClicked({
src/services/dialogService.ts-225-            button_id: 'error_dialog_closed'
src/services/dialogService.ts-226-          })
--
src/scripts/app.ts-19-import { isCloud } from '@/platform/distribution/types'
src/scripts/app.ts-20-import { useSettingStore } from '@/platform/settings/settingStore'
src/scripts/app.ts:21:import { useTelemetry } from '@/platform/telemetry'
src/scripts/app.ts-22-import type { WorkflowOpenSource } from '@/platform/telemetry/types'
src/scripts/app.ts-23-import { useToastStore } from '@/platform/updates/common/toastStore'
--
src/scripts/app.ts-1300-      open_source: openSource ?? 'unknown'
src/scripts/app.ts-1301-    }
src/scripts/app.ts:1302:    useTelemetry()?.trackWorkflowOpened(telemetryPayload)
src/scripts/app.ts:1303:    useTelemetry()?.trackWorkflowImported(telemetryPayload)
src/scripts/app.ts-1304-    await useWorkflowService().afterLoadNewGraph(
src/scripts/app.ts-1305-      workflow,
--
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-3-
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-4-import { isCloud } from '@/platform/distribution/types'
src/platform/workflow/templates/composables/useTemplateWorkflows.ts:5:import { useTelemetry } from '@/platform/telemetry'
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-6-import { useWorkflowTemplatesStore } from '@/platform/workflow/templates/repositories/workflowTemplatesStore'
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-7-import type {
--
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-132-
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-133-        if (isCloud) {
src/platform/workflow/templates/composables/useTemplateWorkflows.ts:134:          useTelemetry()?.trackTemplate({
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-135-            workflow_name: id,
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-136-            template_source: actualSourceModule
--
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-155-
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-156-      if (isCloud) {
src/platform/workflow/templates/composables/useTemplateWorkflows.ts:157:        useTelemetry()?.trackTemplate({
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-158-          workflow_name: id,
src/platform/workflow/templates/composables/useTemplateWorkflows.ts-159-          template_source: sourceModule
--
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-5-import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-6-import { isCloud } from '@/platform/distribution/types'
src/platform/cloud/subscription/composables/useSubscriptionActions.ts:7:import { useTelemetry } from '@/platform/telemetry'
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-8-import { useDialogService } from '@/services/dialogService'
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-9-import { useCommandStore } from '@/stores/commandStore'
--
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-19-  const authActions = useFirebaseAuthActions()
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-20-  const commandStore = useCommandStore()
src/platform/cloud/subscription/composables/useSubscriptionActions.ts:21:  const telemetry = useTelemetry()
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-22-  const { fetchStatus, formattedRenewalDate } = useSubscription()
src/platform/cloud/subscription/composables/useSubscriptionActions.ts-23-
--
src/platform/cloud/subscription/composables/useSubscription.ts-9-import { t } from '@/i18n'
src/platform/cloud/subscription/composables/useSubscription.ts-10-import { isCloud } from '@/platform/distribution/types'
src/platform/cloud/subscription/composables/useSubscription.ts:11:import { useTelemetry } from '@/platform/telemetry'
src/platform/cloud/subscription/composables/useSubscription.ts-12-import { useDialogService } from '@/services/dialogService'
src/platform/cloud/subscription/composables/useSubscription.ts-13-import {
--
src/platform/cloud/subscription/composables/useSubscription.ts-30-function useSubscriptionInternal() {
src/platform/cloud/subscription/composables/useSubscription.ts-31-  const subscriptionStatus = ref<CloudSubscriptionStatusResponse | null>(null)
src/platform/cloud/subscription/composables/useSubscription.ts:32:  const telemetry = useTelemetry()
src/platform/cloud/subscription/composables/useSubscription.ts-33-
src/platform/cloud/subscription/composables/useSubscription.ts-34-  const isSubscribedOrIsNotCloud = computed(() => {
--
src/platform/cloud/subscription/composables/useSubscription.ts-100-  const showSubscriptionDialog = () => {
src/platform/cloud/subscription/composables/useSubscription.ts-101-    if (isCloud) {
src/platform/cloud/subscription/composables/useSubscription.ts:102:      useTelemetry()?.trackSubscription('modal_opened')
src/platform/cloud/subscription/composables/useSubscription.ts-103-    }
src/platform/cloud/subscription/composables/useSubscription.ts-104-
--
src/stores/executionStore.ts-5-import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
src/stores/executionStore.ts-6-import { isCloud } from '@/platform/distribution/types'
src/stores/executionStore.ts:7:import { useTelemetry } from '@/platform/telemetry'
src/stores/executionStore.ts-8-import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
src/stores/executionStore.ts-9-import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
--
src/stores/executionStore.ts-314-  function handleExecutionSuccess(e: CustomEvent<ExecutionSuccessWsMessage>) {
src/stores/executionStore.ts-315-    if (isCloud && activePromptId.value) {
src/stores/executionStore.ts:316:      useTelemetry()?.trackExecutionSuccess({
src/stores/executionStore.ts-317-        jobId: activePromptId.value
src/stores/executionStore.ts-318-      })
--
src/stores/executionStore.ts-389-    lastExecutionError.value = e.detail
src/stores/executionStore.ts-390-    if (isCloud) {
src/stores/executionStore.ts:391:      useTelemetry()?.trackExecutionError({
src/stores/executionStore.ts-392-        jobId: e.detail.prompt_id,
src/stores/executionStore.ts-393-        nodeId: String(e.detail.node_id),
--
src/stores/firebaseAuthStore.ts-25-import { t } from '@/i18n'
src/stores/firebaseAuthStore.ts-26-import { isCloud } from '@/platform/distribution/types'
src/stores/firebaseAuthStore.ts:27:import { useTelemetry } from '@/platform/telemetry'
src/stores/firebaseAuthStore.ts-28-import { useDialogService } from '@/services/dialogService'
src/stores/firebaseAuthStore.ts-29-import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
--
src/stores/firebaseAuthStore.ts-280-
src/stores/firebaseAuthStore.ts-281-    if (isCloud) {
src/stores/firebaseAuthStore.ts:282:      useTelemetry()?.trackAuth({
src/stores/firebaseAuthStore.ts-283-        method: 'email',
src/stores/firebaseAuthStore.ts-284-        is_new_user: false
--
src/stores/firebaseAuthStore.ts-300-
src/stores/firebaseAuthStore.ts-301-    if (isCloud) {
src/stores/firebaseAuthStore.ts:302:      useTelemetry()?.trackAuth({
src/stores/firebaseAuthStore.ts-303-        method: 'email',
src/stores/firebaseAuthStore.ts-304-        is_new_user: true
--
src/stores/firebaseAuthStore.ts-318-      const additionalUserInfo = getAdditionalUserInfo(result)
src/stores/firebaseAuthStore.ts-319-      const isNewUser = additionalUserInfo?.isNewUser ?? false
src/stores/firebaseAuthStore.ts:320:      useTelemetry()?.trackAuth({
src/stores/firebaseAuthStore.ts-321-        method: 'google',
src/stores/firebaseAuthStore.ts-322-        is_new_user: isNewUser
--
src/stores/firebaseAuthStore.ts-336-      const additionalUserInfo = getAdditionalUserInfo(result)
src/stores/firebaseAuthStore.ts-337-      const isNewUser = additionalUserInfo?.isNewUser ?? false
src/stores/firebaseAuthStore.ts:338:      useTelemetry()?.trackAuth({
src/stores/firebaseAuthStore.ts-339-        method: 'github',
src/stores/firebaseAuthStore.ts-340-        is_new_user: isNewUser
--
src/platform/telemetry/topupTracker.ts:1:import { useTelemetry } from '@/platform/telemetry'
src/platform/telemetry/topupTracker.ts-2-import type { AuditLog } from '@/services/customerEventsService'
src/platform/telemetry/topupTracker.ts-3-
--
src/platform/telemetry/topupTracker.ts-45-
src/platform/telemetry/topupTracker.ts-46-  if (completedTopup) {
src/platform/telemetry/topupTracker.ts:47:    useTelemetry()?.trackApiCreditTopupSucceeded()
src/platform/telemetry/topupTracker.ts-48-    localStorage.removeItem(STORAGE_KEY)
src/platform/telemetry/topupTracker.ts-49-    return true
--
src/platform/telemetry/index.ts-30- * for OSS builds and all tracking calls are no-ops.
src/platform/telemetry/index.ts-31- */
src/platform/telemetry/index.ts:32:export function useTelemetry(): TelemetryProvider | null {
src/platform/telemetry/index.ts-33-  if (_telemetryProvider === null) {
src/platform/telemetry/index.ts-34-    // Use distribution check for tree-shaking
--
tests-ui/tests/store/subgraphStore.test.ts-16-// Mock telemetry to break circular dependency (telemetry → workflowStore → app → telemetry)
tests-ui/tests/store/subgraphStore.test.ts-17-vi.mock('@/platform/telemetry', () => ({
tests-ui/tests/store/subgraphStore.test.ts:18:  useTelemetry: () => null
tests-ui/tests/store/subgraphStore.test.ts-19-}))
tests-ui/tests/store/subgraphStore.test.ts-20-
--
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-5-}))
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-6-
tests-ui/tests/platform/telemetry/useTelemetry.test.ts:7:describe('useTelemetry', () => {
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-8-  beforeEach(() => {
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-9-    vi.clearAllMocks()
--
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-11-
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-12-  it('should return null when not in cloud distribution', async () => {
tests-ui/tests/platform/telemetry/useTelemetry.test.ts:13:    const { useTelemetry } = await import('@/platform/telemetry')
tests-ui/tests/platform/telemetry/useTelemetry.test.ts:14:    const provider = useTelemetry()
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-15-
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-16-    // Should return null for OSS builds
--
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-19-
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-20-  it('should return null consistently for OSS builds', async () => {
tests-ui/tests/platform/telemetry/useTelemetry.test.ts:21:    const { useTelemetry } = await import('@/platform/telemetry')
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-22-
tests-ui/tests/platform/telemetry/useTelemetry.test.ts:23:    const provider1 = useTelemetry()
tests-ui/tests/platform/telemetry/useTelemetry.test.ts:24:    const provider2 = useTelemetry()
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-25-
tests-ui/tests/platform/telemetry/useTelemetry.test.ts-26-    // Both should be null for OSS builds
--
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-25-
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-26-vi.mock('@/platform/telemetry', () => ({
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts:27:  useTelemetry: vi.fn(() => mockTelemetry)
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-28-}))
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-29-
--
tests-ui/tests/platform/telemetry/topupTracker.test.ts-21-
tests-ui/tests/platform/telemetry/topupTracker.test.ts-22-vi.mock('@/platform/telemetry', () => ({
tests-ui/tests/platform/telemetry/topupTracker.test.ts:23:  useTelemetry: vi.fn(() => mockTelemetry)
tests-ui/tests/platform/telemetry/topupTracker.test.ts-24-}))
tests-ui/tests/platform/telemetry/topupTracker.test.ts-25-
--
tests-ui/tests/platform/cloud/subscription/composables/useSubscriptionCredits.test.ts-39-
tests-ui/tests/platform/cloud/subscription/composables/useSubscriptionCredits.test.ts-40-vi.mock('@/platform/telemetry', () => ({
tests-ui/tests/platform/cloud/subscription/composables/useSubscriptionCredits.test.ts:41:  useTelemetry: () => ({
tests-ui/tests/platform/cloud/subscription/composables/useSubscriptionCredits.test.ts-42-    track: vi.fn()
tests-ui/tests/platform/cloud/subscription/composables/useSubscriptionCredits.test.ts-43-  })
--
tests-ui/tests/platform/settings/components/SettingItem.test.ts-12-const trackSettingChanged = vi.fn()
tests-ui/tests/platform/settings/components/SettingItem.test.ts-13-vi.mock('@/platform/telemetry', () => ({
tests-ui/tests/platform/settings/components/SettingItem.test.ts:14:  useTelemetry: vi.fn(() => ({
tests-ui/tests/platform/settings/components/SettingItem.test.ts-15-    trackSettingChanged
tests-ui/tests/platform/settings/components/SettingItem.test.ts-16-  }))
--
tests-ui/tests/composables/useTemplateFiltering.test.ts-25-
tests-ui/tests/composables/useTemplateFiltering.test.ts-26-vi.mock('@/platform/telemetry', () => ({
tests-ui/tests/composables/useTemplateFiltering.test.ts:27:  useTelemetry: vi.fn(() => ({
tests-ui/tests/composables/useTemplateFiltering.test.ts-28-    trackTemplateFilterChanged: vi.fn()
tests-ui/tests/composables/useTemplateFiltering.test.ts-29-  }))

</shell_result>


Script executed:

#!/bin/bash
# Find the initialization function in remoteConfig
cat -n src/platform/remoteConfig/remoteConfig.ts | head -60

# Also search for where loadRemoteConfig or similar is called
rg -n 'loadRemoteConfig\|\.value\s*=' src/platform/remoteConfig/remoteConfig.ts -B2 -A2

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 1

stdout:

     1	/**
     2	 * Remote configuration service
     3	 *
     4	 * Fetches configuration from the server at runtime, enabling:
     5	 * - Feature flags without rebuilding
     6	 * - Server-side feature discovery
     7	 * - Version compatibility management
     8	 * - Avoiding vendor lock-in for native apps
     9	 *
    10	 * This module is tree-shaken in OSS builds.
    11	 * Used for initial config load in main.ts and polling in the extension.
    12	 */
    13	
    14	import { ref } from 'vue'
    15	
    16	import type { RemoteConfig } from './types'
    17	
    18	/**
    19	 * Reactive remote configuration
    20	 * Updated whenever config is loaded from the server
    21	 */
    22	export const remoteConfig = ref<RemoteConfig>({})
    23	
    24	export function configValueOrDefault<K extends keyof RemoteConfig>(
    25	  remoteConfig: RemoteConfig,
    26	  key: K,
    27	  defaultValue: NonNullable<RemoteConfig[K]>
    28	): NonNullable<RemoteConfig[K]> {
    29	  const configValue = remoteConfig[key]
    30	  return configValue || defaultValue
    31	}
    32	
    33	/**
    34	 * Loads remote configuration from the backend /api/features endpoint
    35	 * and updates the reactive remoteConfig ref
    36	 */
    37	export async function loadRemoteConfig(): Promise<void> {
    38	  try {
    39	    const response = await fetch('/api/features', { cache: 'no-store' })
    40	    if (response.ok) {
    41	      const config = await response.json()
    42	      window.__CONFIG__ = config
    43	      remoteConfig.value = config
    44	    } else {
    45	      console.warn('Failed to load remote config:', response.statusText)
    46	      window.__CONFIG__ = {}
    47	      remoteConfig.value = {}
    48	    }
    49	  } catch (error) {
    50	    console.error('Failed to fetch remote config:', error)
    51	    window.__CONFIG__ = {}
    52	    remoteConfig.value = {}
    53	  }
    54	}

</shell_result>


Script executed:

#!/bin/bash
# Find main.ts and check loadRemoteConfig call
find . -name 'main.ts' -type f | grep -v node_modules | head -5

# Search for loadRemoteConfig calls
rg -n 'loadRemoteConfig' --type ts -B3 -A3

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

./.storybook/main.ts
./apps/desktop-ui/.storybook/main.ts
./apps/desktop-ui/src/main.ts
./src/main.ts
src/extensions/core/cloudRemoteConfig.ts:1:import { loadRemoteConfig } from '@/platform/remoteConfig/remoteConfig'
src/extensions/core/cloudRemoteConfig.ts-2-import { useExtensionService } from '@/services/extensionService'
src/extensions/core/cloudRemoteConfig.ts-3-
src/extensions/core/cloudRemoteConfig.ts-4-/**
--
src/extensions/core/cloudRemoteConfig.ts-10-
src/extensions/core/cloudRemoteConfig.ts-11-  setup: async () => {
src/extensions/core/cloudRemoteConfig.ts-12-    // Poll for config updates every 30 seconds
src/extensions/core/cloudRemoteConfig.ts:13:    setInterval(() => void loadRemoteConfig(), 30000)
src/extensions/core/cloudRemoteConfig.ts-14-  }
src/extensions/core/cloudRemoteConfig.ts-15-})
--
src/main.ts-27-import { isCloud } from '@/platform/distribution/types'
src/main.ts-28-
src/main.ts-29-if (isCloud) {
src/main.ts:30:  const { loadRemoteConfig } = await import(
src/main.ts-31-    '@/platform/remoteConfig/remoteConfig'
src/main.ts-32-  )
src/main.ts:33:  await loadRemoteConfig()
src/main.ts-34-}
src/main.ts-35-
src/main.ts-36-const ComfyUIPreset = definePreset(Aura, {
--
src/platform/remoteConfig/remoteConfig.ts-34- * Loads remote configuration from the backend /api/features endpoint
src/platform/remoteConfig/remoteConfig.ts-35- * and updates the reactive remoteConfig ref
src/platform/remoteConfig/remoteConfig.ts-36- */
src/platform/remoteConfig/remoteConfig.ts:37:export async function loadRemoteConfig(): Promise<void> {
src/platform/remoteConfig/remoteConfig.ts-38-  try {
src/platform/remoteConfig/remoteConfig.ts-39-    const response = await fetch('/api/features', { cache: 'no-store' })
src/platform/remoteConfig/remoteConfig.ts-40-    if (response.ok) {

</shell_result>


Script executed:

#!/bin/bash
# Check how window.__CONFIG__ is initialized vs remoteConfig
rg -n 'window\.__CONFIG__' --type ts -B2 -A2 | head -40

Repository: Comfy-Org/ComfyUI_frontend


<shell_result>
Repository: Comfy-Org/ComfyUI_frontend
Exit code: 0

stdout:

vitest.setup.ts-42-
vitest.setup.ts-43-// Define runtime config for tests
vitest.setup.ts:44:window.__CONFIG__ = {
vitest.setup.ts-45-  subscription_required: true,
vitest.setup.ts-46-  mixpanel_token: 'test-token',
--
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-79-    mockTelemetry.trackSubscription.mockReset()
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-80-    mockTelemetry.trackMonthlySubscriptionCancelled.mockReset()
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts:81:    window.__CONFIG__ = {
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-82-      subscription_required: true
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts:83:    } as typeof window.__CONFIG__
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-84-    vi.mocked(global.fetch).mockResolvedValue({
tests-ui/tests/platform/cloud/subscription/useSubscription.test.ts-85-      ok: true,
--
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-94-  constructor() {
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-95-    this.configureDisabledEvents(
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts:96:      (window.__CONFIG__ as Partial<RemoteConfig> | undefined) ?? null
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-97-    )
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-98-    watch(remoteConfig, (config) => {
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-99-      this.configureDisabledEvents(config)
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-100-    })
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts:101:    const token = window.__CONFIG__?.mixpanel_token
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-102-
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts-103-    if (token) {
--
src/platform/settings/composables/useSettingUI.ts-82-
src/platform/settings/composables/useSettingUI.ts-83-  const subscriptionPanel: SettingPanelItem | null =
src/platform/settings/composables/useSettingUI.ts:84:    !isCloud || !window.__CONFIG__?.subscription_required
src/platform/settings/composables/useSettingUI.ts-85-      ? null
src/platform/settings/composables/useSettingUI.ts-86-      : {
--
src/platform/settings/composables/useSettingUI.ts-151-      ...(isElectron() ? [serverConfigPanel] : []),
src/platform/settings/composables/useSettingUI.ts-152-      ...(isCloud &&
src/platform/settings/composables/useSettingUI.ts:153:      window.__CONFIG__?.subscription_required &&
src/platform/settings/composables/useSettingUI.ts-154-      subscriptionPanel
src/platform/settings/composables/useSettingUI.ts-155-        ? [subscriptionPanel]
--
src/platform/settings/composables/useSettingUI.ts-188-        ...(isLoggedIn.value &&
src/platform/settings/composables/useSettingUI.ts-189-        isCloud &&
src/platform/settings/composables/useSettingUI.ts:190:        window.__CONFIG__?.subscription_required &&

</shell_result>


Based on my thorough verification, I have confirmed the issue identified in the review comment. Let me provide the rewritten review comment:


The watcher needs { immediate: true } to ensure initial configuration from remoteConfig.

In main.ts, await loadRemoteConfig() is called during app initialization (line 33), which populates remoteConfig.value before components mount. When MixpanelTelemetryProvider is constructed later, the watcher is set up after remoteConfig already has its value. Without { immediate: true }, Vue's watch will not fire for the initial/current value—it only fires on subsequent changes. While the constructor calls configureDisabledEvents with window.__CONFIG__ (which is set to the same value), the pattern is fragile and doesn't explicitly handle the initial remoteConfig state. Add { immediate: true } to ensure configureDisabledEvents is called with the current remoteConfig value immediately upon watcher setup.

watch(remoteConfig, (config) => {
  this.configureDisabledEvents(config)
}, { immediate: true })
🤖 Prompt for AI Agents
In src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts around
lines 95 to 100, the watcher on remoteConfig is missing the { immediate: true }
option so it won’t invoke configureDisabledEvents with the current remoteConfig
value if that value was set before the watcher was created; update the watch
call to include { immediate: true } so configureDisabledEvents is called
immediately with the current config when the watcher is registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cloud cloud/1.32 needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants