Conversation
- asyncResource is now an EventEmitterReferencingAsyncResource with an eventEmitter getter pointing back to the owning emitter - asyncId, triggerAsyncId, and asyncResource are prototype getters instead of own value properties - constructing EventEmitterAsyncResource directly without options.name throws ERR_INVALID_ARG_TYPE (subclasses default to new.target.name) - emit() forwards the boolean returned by EventEmitter#emit
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
|
Updated 4:02 PM PT - Jul 7th, 2026
❌ @robobun, your commit d69de04 has 1 failures in
🧪 To try this PR locally: bunx bun-pr 33689That installs a local version of the PR into your bun-33689 --bun |
|
Found 1 issue this PR may fix:
🤖 Generated with Claude Code |
|
This PR may be a duplicate of:
🤖 Generated with Claude Code |
|
On the bot suggestions above: #32168: this change makes that issue's repro print Overlap:
|
|
The diff is ready. CI red on build 70003 is unrelated to this change:
|
|
Closing as part of a cleanup of stale pull requests. This PR has had no new commits since 2026-07-07, it conflicts with main, and its last CI run failed. This is not a judgment on the fix itself. If the problem still reproduces on a current build, reopen this PR after a rebase or open a new one against main. |
Repro
asyncResource.constructor.nameEventEmitterReferencingAsyncResourceAsyncResource"eventEmitter" in asyncResourcetruefalseasyncResource.eventEmitter === rtruefalseasyncId,asyncResource,constructor,emit,emitDestroy,triggerAsyncIdconstructor,emit,emitDestroynew EventEmitterAsyncResource()ERR_INVALID_ARG_TYPECause
src/js/node/events.tsconstructedthis.asyncResource = new AsyncResource(name, ...)directly and storedasyncResource/triggerAsyncIdas own instance properties. There was noEventEmitterReferencingAsyncResourcesubclass, noeventEmitterback-reference, no prototype accessors, and nooptions.namevalidation.emit()also discarded therunInAsyncScopereturn value.Fix
Rewrote the class to mirror Node's implementation:
asyncResourceis anEventEmitterReferencingAsyncResource(extendsAsyncResource) with a#eventEmitterprivate field exposed via aneventEmittergetter.asyncId,triggerAsyncId, andasyncResourceare prototype getters backed by a#asyncResourceprivate field, so accessing them on an invalid receiver throwsTypeErrorlike Node.new.target === EventEmitterAsyncResource),options.nameis validated withvalidateStringand throwsERR_INVALID_ARG_TYPEif missing or not a string. Subclasses default tonew.target.name. A bare string argument is still accepted as the name.emit()now returns the boolean fromsuper.emit(also addressed by node:events: return boolean from EventEmitterAsyncResource#emit #33688; this change subsumes it).AsyncResourcecontinues to be required lazily on first construction to avoid a bootstrap cycle withnode:async_hooks.Verification
Added tests to
test/js/node/async_hooks/EventEmitterAsyncResource.test.tscovering the back-reference, prototype shape,options.namevalidation, subclass defaulting, string-name form,emit()return value, and invalid-receiver errors. All new tests fail on the released binary and pass with this change; the existingnode:eventsandnode:async_hookssuites remain green.