Repository navigation
fix(clipboard): report a failed copy to Sentry once, not twice - #2916
Conversation
captureConsoleIntegration promotes every console.error into its own event, and a non-Error argument arrives as a stackless message. Logging the failure map right before captureException therefore produced two Sentry issues per failed copy. Keep the explicit capture, which carries the failed-methods context, and pin the single event with a console assertion.
|
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: Path: .coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code-analysis diffPainscore total: 7088.8 → 7088.85 (+0.05) 🆕 New findings (4)
✅ Resolved (4)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
There was a problem hiding this comment.
Chip review — no blocking findings — this is not an approval
The duplicate Sentry event is removed without changing clipboard behavior or losing the structured failure report.
Checked clean
- Verified the detached HEAD, trusted author, dev base SHA, exact head SHA, and merge base against the supplied inputs.
- Reviewed all changed lines and surrounding clipboard failure paths: the explicit captureException and failed-method context remain, while the console.error captured by Sentry is removed.
- Confirmed the new regression assertion covers the removed console event and the browser Sentry configuration captures console error and warn levels.
- Reviewed correctness, security, adversarial failure scenarios, and slop; copied text remains excluded from telemetry and no user-facing clipboard result changes.
- CI unit, typecheck, eslint, format, analyze, and policy gates succeeded at the exact head; the focused local Jest run was unavailable because the detached worktree has no node_modules.
Second opinion by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only, so treat its findings as advice.
Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.
Exact head: 58225f5ce540 · Context: repo · Took 6m
Summary
Follow-up to #2911.
copyTextToClipboardlogged the failure map withconsole.errorright beforecaptureException.captureConsoleIntegrationis on for theerrorlevel and promotes a non-Error console argument into its own stackless message event, so every copy that failed every path produced two Sentry issues instead of the one the PR intended, and re-created the stackless-message class #2810 cleaned up.console.error; keep the explicitcaptureException, which carries theextra.failedcontext.console.errorwas never called, which the old test could not catch because it only countedcaptureException.Task
TASK-21690 — https://app.notion.com/p/3c283811757981758696de3bc36cc022
Risks / breaking changes
None. No behaviour change for the user; one fewer Sentry event per failed copy.
QA
Unit:
src/utils/__tests__/clipboard.utils.test.ts(12 passing locally).Screenshots: N/A — no UI change.