-
-
Notifications
You must be signed in to change notification settings - Fork 1
All remote instances share one module-level event emitter #43
Copy link
Copy link
Closed
Labels
area: coreTouches core library / runtime source codeTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitNeeds attention soon — not blocking, but don't let it sitstatus: implementedBuilt and deployed, but not yet fully tested/verifiedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expectedSomething is broken or not behaving as expected
Description
Activity
Metadata
Metadata
Assignees
Labels
area: coreTouches core library / runtime source codeTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitNeeds attention soon — not blocking, but don't let it sitstatus: implementedBuilt and deployed, but not yet fully tested/verifiedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expectedSomething is broken or not behaving as expected
Problem
src/lib/android-tv-remote.mjscreates its event emitter once, at module scope. Every remote returned bycreateRemote()therefore shares it. With two TVs, listeners on one remote get the other remote's events (connect, disconnect, key and error events), and removing listeners on one affects the other.Found during the release-docs backfill (#41).
Fix
Create one emitter per remote instance, inside
createRemote(), and route allemit/on/offthrough it. Add a test that creates two remotes, emits on one, and asserts the other's listener doesn't fire. Instances must be independent without opening real connections.