Expose ComfyUI telemetry bridge#1069
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a043880e14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR extracts ComfyDesktop bridge types into a reusable npm package, extends telemetry to support array-valued properties while enforcing primitives-only validation for person attributes, implements PII redaction for string array elements, and exposes a new renderer-side Telemetry bridge with error-safe IPC forwarding. ChangesBridge Types Extraction and Telemetry Enhancement
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/lib/ipc/registerTelemetryHandlers.ts`:
- Around line 37-53: The asProps/isTelemetryValueArray validation currently
accepts unbounded renderer-controlled objects and arrays; limit work done at the
IPC boundary by enforcing caps: in asProps, stop iterating after a maxKeys
threshold (e.g., 50) and ignore additional keys; in isTelemetryValueArray, cap
checked/retained array length to maxArrayLen (e.g., 20) and only validate/trust
up to that many items; when accepting string TelemetryValue (checked by
isTelemetryValue), truncate strings to a maxStringLen (e.g., 200) before
assigning into the returned mainTelemetry.TelemetryContext; update references to
isTelemetryValue/isTelemetryValueArray and the out assignment logic so oversized
inputs are skipped/truncated rather than fully processed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ba60f3b5-b89b-4700-a918-679fae3bbba1
📒 Files selected for processing (4)
src/main/lib/ipc/registerTelemetryHandlers.tssrc/main/lib/telemetry.test.tssrc/main/lib/telemetry.tssrc/preload/comfyPreload.ts
db68fab to
adeae82
Compare
1af49ec to
db8fe8f
Compare
db8fe8f to
80fd10e
Compare
Summary
window.__comfyDesktop2.Telemetry.capturefrom the ComfyUI preload bridgetelemetry:captureIPC pathPaired change
Validation
pnpm run typecheckpnpm run lintpnpm run buildpnpm run test