Skip to content

FE-3367 feat(telemetry): mirror Desktop SSO sign-in to Datadog - #1695

Merged
dante01yoon merged 1 commit into
mainfrom
jaewon/fe-3367-mirror-host-sign-in
Oct 10, 2026
Merged

dante01yoon merged 1 commit into
mainfrom
jaewon/fe-3367-mirror-host-sign-in

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

Why

The SSO dashboards and monitors live in Datadog. comfy.desktop.auth.host_sign_in (added in #1694) only reached PostHog, because forwardToRenderer and trackTelemetryAction mirror only names on DATADOG_MIRRORED_EVENT_NAMES.

How

Add comfy.desktop.auth.host_sign_in to the allow-list. The whole event is mirrored, every stage included, the same way as install.phase: dashboards need requested/completed as the denominator, and monitors filter on stage:failed.

In Datadog RUM (service:comfyui-desktop-2, env:prod-v2, us5) it lands as a custom action:

  • Query: @type:action @action.type:custom @action.name:comfy.desktop.auth.host_sign_in
  • @context.stage: requested | completed | failed
  • @context.reason (failed only): cancelled | timeout | idp_error | server_error | network | browser_unavailable | superseded | unknown
  • @context.http_status (failed only, when known): number
  • @context.host: desktop

No PII: main forwards only the event's own properties (stage, host, reason code, HTTP status). It does not forward PostHog default properties, email, name or IdP text. The renderer adds the usual cohort global context and the device-ID usr.id, which every RUM event already carries.

Change breakdown (total 15 changed lines):

Category Files Added Deleted Share
Product 1: src/shared/datadogMirroredEvents.ts 5 0 33%
Test 1: src/shared/datadogMirroredEvents.test.ts 10 0 67%

Test plan

  • pnpm exec vitest run src/shared/datadogMirroredEvents.test.ts src/main/lib/telemetry.test.ts src/main/lib/ipc/registerEmbeddedSessionHandlers.test.ts: 218 passed
  • New case fails without the allow-list entry (red), passes with it (green)
  • Pre-commit: typecheck (node/web/e2e/integration), eslint ., prettier --check

Links

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 46cb7e5a-8a7c-456c-a9c5-489261a379c0

📥 Commits

Reviewing files that changed from the base of the PR and between 3ea3ad4 and 9699cac.


📒 Files selected for processing (2)
  • src/shared/datadogMirroredEvents.test.ts
  • src/shared/datadogMirroredEvents.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.



📝 Walkthrough

Walkthrough

The Datadog mirrored-event allow-list now includes hosted-view sign-in events. Parameterized tests check which sign-in stages are expected to mirror.

Changes

Hosted-view sign-in event mirroring

Layer / File(s) Summary
Allow-list entry and stage expectations
src/shared/datadogMirroredEvents.ts, src/shared/datadogMirroredEvents.test.ts
The allow-list includes comfy.desktop.auth.host_sign_in. Tests expect host_sign_in and sign_in_failed to mirror, and sign_in_started not to mirror.

Suggested reviewers: kosinkadink


Priority: ⬇️ Low

Merge Risk | ⚪ Minimal · up to 9699c

Merge Risk: ⚪ Minimal · up to 9699c

The change adds hosted-view sign-in telemetry to Datadog mirroring without a demonstrated regression in the supplied review context.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9699c

Sign-in stages now reach the existing monitoring provider, including the usual device identifier and cohort context. The event producer selects bounded outcome fields, and existing consent and volume controls remain in place. No introduced vulnerability was established, but privacy and delivery coverage is incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated expansion is hosted sign-in outcome metadata reaching the configured Datadog RUM destination for eligible telemetry sessions. The full PR diff introduces no new authentication privilege, token sink, tenant selector, IAM configuration or deployment destination.

Trust Boundaries and Controls

  • observed — Mirror eligibility is not a consent exemption. Both main and renderer exempt only the consent-decision event; host_sign_in requires granted telemetry consent. Main capture applies volume controls, and renderer delivery independently checks its budget and Datadog initialization before sending scrubbed context with dropped keys removed.

Resilience and Maintainability Implications

  • observed — The existing producer suppresses duplicate telemetry while an attempt is in flight, reports completion or failure, and clears its guard in finally. Identity-quarantined events are forwarded only on replay; conflicting identity resolution or denied consent discards buffered writes. Relay errors are isolated rather than allowed to break sign-in.

Pre-merge checks | Passed 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

✨ Simplify code
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed at head 9699caca3446750a26c69c1fd82980af6e9476b7.

Clean, well-scoped change: adds comfy.desktop.auth.host_sign_in to the Datadog mirror allow-list in src/shared/datadogMirroredEvents.ts so the hosted-view SSO sign-in funnel (from #1694) reaches Datadog the same way install.phase does, with a parameterized test confirming host_sign_in and sign_in_failed mirror while the separate Firebase-bridge sign_in_started stays PostHog-only.

Checked the no-PII claim against hostSignInTelemetry.ts directly rather than trusting the PR body: the reported properties are only stage, host, and on failure reason/http_status — no email, name, or IdP text. forwardToRenderer mirrors only the event's own context object, so nothing beyond that reaches the renderer's Datadog SDK.

CI fully green (typecheck, lint, format, unit/integration/E2E across all three OSes, CodeRabbit "no actionable comments"), no open review threads, no package/export surface touched. Approving.

@dante01yoon
dante01yoon added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 0f15956 Oct 10, 2026
16 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-3367-mirror-host-sign-in branch October 10, 2026 23:45
artifyfun added a commit to artifyfun/Comfy-Desktop that referenced this pull request Oct 12, 2026
…Datadog 镜像;启动失败可见性;beta grant 即时生效)

上游要点(upstream/main → artifylab-v2,17 提交,官方 1.1.6 → 1.1.7-rc.3):
- feat(telemetry): Core 的 [agent-event] 日志行转发为 agent telemetry;Desktop SSO 登录事件上报并镜像到 Datadog(Comfy-Org#1668 / Comfy-Org#1694 / Comfy-Org#1695)
- fix(telemetry): assets tap 的未终止尾部不再解析;未知事件与枚举值仅在取得遥测同意后才计数;打包环境隔离 PostHog;Datadog release 版本归一化(Comfy-Org#1669 / Comfy-Org#1661 / Comfy-Org#1630 / Comfy-Org#1631)
- fix(launch): 展示 ComfyUI 资产数据库启动失败,无 --enable-assets 时给出锁提示(Comfy-Org#1688)
- fix(perf-test): 已有 ComfyUI 在跑时拒绝发起性能测试(Comfy-Org#1643)
- fix(update): 更新时保留 ComfyUI checkout 内的未跟踪文件(Comfy-Org#1677)
- fix(ops-flag): 保存的 beta grant 立即生效并在后台刷新(Comfy-Org#1678)
- fix(auth): OAuth 请求存活期间持续等待浏览器登录;再次请求登录时重开待处理的浏览器(Comfy-Org#1681 / Comfy-Org#1685)
- test(launch): 每次运行使用独立 settings 目录,避免并发互相干扰(Comfy-Org#1663)
- chore: 官方版本号 1.1.7-rc.1 / rc.2 / rc.3(Comfy-Org#1682 / Comfy-Org#1687 / Comfy-Org#1690)

未收录:上游对 .github/workflows/ 的两个改动已回退到 fork 版——本机 Git Credential Manager 的 GitHub OAuth 令牌缺 workflow scope,GitHub 拒绝任何更新 .github/workflows/** 的推送。涉及:build-release.yml 的 Datadog release_version 改 heredoc 写法(Comfy-Org#1631 附带)、ci.yml 新增 python-git-helpers 测试 job。待令牌补上 workflow scope 后按上游版本补回。

冲突:仅 package.json 的身份字段(name/version/description),按本仓口径取 fork 侧(artify-desktop / 1.11.0),上游仅有的 version bump 由 fork 版本号取代。

依赖变化:无新增(pnpm-lock.yaml 未动,上游本范围内 package.json 只改了 version 行)。

验证:三方行级校验(fork 新增行 / 上游新增行均保留,唯一丢失行是上游 version 字面量,属预期取代);typecheck:node + typecheck:web 通过;主进程 vitest 376 文件 7436 passed / 0 failed;前端 29 文件 460 passed(首跑 1 例 5s 超时 flake,复跑两次均全绿)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants