Skip to content

fix(js): send the reporter's own events through the client report - #685

Merged
sunnylqm merged 1 commit into
masterfrom
claude/reporter-dispatch
Oct 16, 2026
Merged

sunnylqm merged 1 commit into
masterfrom
claude/reporter-dispatch

Conversation

@sunnylqm

@sunnylqm sunnylqm commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

#684 的 CodeRabbit 意见:拆分后 reportInvalidUpdateOnce 和 emitError 直接调用了 Reporter 自己的 report。如果有人在实例上替换或 spy 了 client.report,就收不到这两类事件。拆分前它们都经由 this.report,这违背了那个 PR 里写明的规则:调用公开成员一律经由 client 实例。

现在 Reporter 通过 host 的 report 发出这两类事件,client.ts 把 host 的 report 接到 client.report。

新增回归测试:spy client.report 后,emitError 和 reportInvalidUpdateOnce 的事件都能被观察到。去掉修复后这个测试失败。bun run lint 通过,bun test 459 个用例全部通过。

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Error events are now sent through the client’s reporting channel. This applies to emitted errors and one-time invalid-update reports, with the error message and update version included in the reported details. Error reporting now uses a consistent path for these events.

reportInvalidUpdateOnce and emitError called the reporter's report directly
after #684, so a replaced or spied client.report missed them; before the
split both went through this.report. The reporter now raises them through
its host's report, like every other part of the client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7328d05-a3e5-4731-8d4e-0752d563ef29
📥 Commits

Reviewing files that changed from the base of the PR and between 434aa3c and 694ea7e.

📒 Files selected for processing: 3
  • src/__tests__/client.test.ts
  • src/client.ts
  • src/clientReporter.ts

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

📝 Walkthrough

Reporter error events now pass through the client’s report method. A test checks that emitError and reportInvalidUpdateOnce send their respective event data through this method.

Changes: Client reporting

Layer / File(s) Summary
Reporter event routing
src/clientReporter.ts, src/client.ts, src/__tests__/client.test.ts
ReporterHost exposes report, and the client connects it to this.report. emitError and reportInvalidUpdateOnce use this entry point. The test checks the reported event types and data.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 694ea

Reporter-generated error events reach the client reporting hook, and the regression test checks their event data. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: routing the reporter's own events through the client's report method.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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 docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

@sunnylqm
sunnylqm merged commit 8e490df into master Oct 16, 2026
13 checks passed
@sunnylqm
sunnylqm deleted the claude/reporter-dispatch branch October 16, 2026 08:34
@sunnylqm sunnylqm mentioned this pull request Oct 16, 2026
sunnylqm added a commit that referenced this pull request Oct 17, 2026
Bump package.json and harmony/pushy/oh-package.json5 together, with the
bilingual release notes. Ships everything since 10.60.0: the shared native
round engine (#673-#681), the cross-platform alignment and fixes (#664,
#666, #671, #687, #688), the JS client fixes and split (#667, #684, #685),
the bounded host prepareBundle (#669), the generated cross-platform contract
(#683, #686) and the trimmed npm package (#670).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant