Skip to content

All remote instances share one module-level event emitter #43

Description

@Shinrai

Problem

src/lib/android-tv-remote.mjs creates its event emitter once, at module scope. Every remote returned by createRemote() 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 all emit/on/off through 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions