Skip to content

fix(polyfill): report already-connected gamepads to the first listener - #163

Merged
triniwiz merged 2 commits into
masterfrom
fix/polyfill-gamepad-connected
Sep 28, 2026
Merged

triniwiz merged 2 commits into
masterfrom
fix/polyfill-gamepad-connected

Conversation

@triniwiz

Copy link
Copy Markdown
Member

hookGamepadListeners started the gamepad backend before registering the caller's listener. The iOS, Android and Windows backends report controllers that are already connected synchronously when they start, so the first gamepadconnected listener never saw them. The listener is now registered first.

  • packages/canvas-polyfill/gamepad.ts: register the listener, then start the backend.
  • packages/canvas-polyfill/__test__/gamepad.test.mjs: regression test using a fake backend that reports a pad on start. It fails before the fix and passes after.
  • Bumps @nativescript/canvas-polyfill to 3.0.0-alpha.19.

Testing

node --test packages/canvas-polyfill/__test__/gamepad.test.mjs packages/canvas-gamepad/__test__/common.test.mjs passes (8 tests).

hookGamepadListeners started the gamepad backend before registering the
caller's listener. The backends report already-connected controllers
synchronously on start, so the first gamepadconnected listener missed
them. Register the listener first.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e07fcefc-9305-4fa3-b5eb-24facbe4e90a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@triniwiz
triniwiz merged commit e8cd974 into master Sep 28, 2026
14 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant