Skip to content

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

Closed

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

  1. added
    type: bug
    priority: high
    status: confirmed
    area: core
    on Oct 4, 2026
  2. added
    status: implemented
    and removed
    status: confirmed
    on Oct 4, 2026
  3. cldmv-bot commented on Oct 4, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #46, merged into next. This issue closes automatically when that work ships to the default branch.

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: corepriority: highstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions