Skip to content

fix: prevent listener accumulation in EventEmitter subclasses#15

Merged
stoprocent merged 2 commits into
mainfrom
claude/fix-eventemitter-listeners-UCJMd
Feb 20, 2026
Merged

fix: prevent listener accumulation in EventEmitter subclasses#15
stoprocent merged 2 commits into
mainfrom
claude/fix-eventemitter-listeners-UCJMd

Conversation

@stoprocent
Copy link
Copy Markdown
Owner

Add NobleEventEmitter base class with onceExclusive() method that ensures at most one listener exists for a given event, preventing memory leaks when callback-based methods are called repeatedly before the event fires.

All EventEmitter subclasses now extend NobleEventEmitter, and the this.once() calls in Bleno's callback patterns are replaced with this.onceExclusive().

https://claude.ai/code/session_01ACdNMshQv7DuLM4bAqgMZb

Add NobleEventEmitter base class with onceExclusive() method that
ensures at most one listener exists for a given event, preventing
memory leaks when callback-based methods are called repeatedly before
the event fires.

All EventEmitter subclasses now extend NobleEventEmitter, and the
this.once() calls in Bleno's callback patterns are replaced with
this.onceExclusive().

https://claude.ai/code/session_01ACdNMshQv7DuLM4bAqgMZb
Rename the base class from NobleEventEmitter to BlenoEventEmitter to
match the project name, and update package-lock.json to resolve
@stoprocent/bluetooth-hci-socket@2.2.5 to fix npm ci sync issue.

https://claude.ai/code/session_01ACdNMshQv7DuLM4bAqgMZb
@stoprocent stoprocent force-pushed the claude/fix-eventemitter-listeners-UCJMd branch from 50f9c3b to 5eb40c5 Compare February 20, 2026 10:01
@stoprocent stoprocent merged commit 9ed8b79 into main Feb 20, 2026
28 of 29 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 0.12.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants