Skip to content

fix(telemetry): address CodeRabbit review from #1132#1145

Merged
deepme987 merged 1 commit into
mainfrom
deepme987/desktop/telemetry-review-followups
Jun 18, 2026
Merged

fix(telemetry): address CodeRabbit review from #1132#1145
deepme987 merged 1 commit into
mainfrom
deepme987/desktop/telemetry-review-followups

Conversation

@deepme987

Copy link
Copy Markdown
Collaborator

Description

Follow-ups to the install → boot → canvas instrumentation merged in #1132. CodeRabbit posted four actionable comments after that PR was squash-merged, so they land here. All are side-channel hardening — no change to the funnel events themselves.

  1. canvasEntry.ts — clamp server_ready_to_canvas_ms to >= 0. Date.now() can move backward (clock skew), which would emit a negative, funnel-polluting duration. Math.max(0, …).
  2. installer.withInstallPhase — isolate the onPhase tap. The phase tap is documented side-channel-only, but a throwing onPhase could abort or mask an install. Each invocation is now wrapped in try/catch (safeOnPhase).
  3. install.emitInstallPhase — guard classification/emission. Telemetry bucketing/emit is wrapped so a failure can't derail a post-install phase (this function is also the installer's onPhase tap, so this guards both paths).
  4. useCloudCapacity.test.ts — fix the loadComposable return type. Awaited<ReturnType<typeof importComposable>> resolved to the composable function; the value assigned is its call result. Now ReturnType<Awaited<ReturnType<typeof importComposable>>>, matching the inner composable declaration.

How has this been tested?

  • typecheck:node + typecheck:web — clean.
  • vitest run on canvasEntry.test.ts, bootPhaseBuffer.test.ts, useCloudCapacity.test.ts — 33 passing.

Related

Follow-up to #1132 (merged). Resolves the four CodeRabbit threads on that PR.

Follow-ups to the merged install -> boot -> canvas instrumentation (#1132);
all side-channel-hardening, no behavior change to the funnel events:

- canvasEntry: clamp server_ready_to_canvas_ms to >= 0 so a backward clock
  step can't emit a negative, funnel-polluting duration.
- installer.withInstallPhase: isolate every onPhase tap in try/catch so a
  throwing telemetry callback can never abort or mask an install.
- install.emitInstallPhase: guard classification/emission so side-channel
  metrics fail quietly (this is also the installer's onPhase tap).
- useCloudCapacity.test: fix the loadComposable return type — it resolved to
  the composable function, not its call result.
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 52227200-250d-401d-b523-57f2d605f83c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deepme987/desktop/telemetry-review-followups
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch deepme987/desktop/telemetry-review-followups

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

@deepme987 deepme987 marked this pull request as ready for review June 18, 2026 05:27
@deepme987 deepme987 enabled auto-merge (squash) June 18, 2026 05:28
@MaanilVerma MaanilVerma self-requested a review June 18, 2026 05:59
@deepme987 deepme987 merged commit 2573585 into main Jun 18, 2026
12 checks passed
@deepme987 deepme987 deleted the deepme987/desktop/telemetry-review-followups branch June 18, 2026 05:59
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