Skip to content

test(conformance): replay shared fixtures - #7

Merged
lutz-grex merged 2 commits into
mainfrom
lucius/react-conformance
Nov 17, 2026
Merged

lutz-grex merged 2 commits into
mainfrom
lucius/react-conformance

Conversation

@lutz-grex

Copy link
Copy Markdown
Contributor

Summary

React now replays the shared SDK conformance fixtures (v0.2.0) on every pull request, so it behaves like the native Kotlin, Swift and Flutter SDKs. This fixes keys that stayed pressed on the device and adds the polling fallback for task approvals.

Changes

  • Vendored fixtures in conformance/fixtures (release tag in conformance/VERSION) and scripts/sync-conformance.sh TAG [CLONE_DIR] to update them.
  • Table-driven tests for control messages, signalling frames (including timings and data-channel options), reconnect policy and scenarios, and input routing; a check fails when a fixture file is not covered.
  • Input decisions moved from use-scrcpy-input into src/lib/input-routing.ts; the hook keeps DOM wiring only and now lets the router see releases that arrive while the control channel is closed, so no gesture stays active after a reconnect.
  • Keys without text that are not in the code map (for example ContextMenu, numpad keys with NumLock off) now send DOWN and UP instead of leaving the key pressed; shortcuts and text no longer produce stray releases; a single emoji or combining sequence is typed as text.
  • Touches use stable pointer slots 0-9 on the wire; non-primary mouse buttons no longer start a touch.
  • useTaskApproval: when subscribe throws, the error goes to onError and the hook polls at pollIntervalMs (3 s by default; an explicit 0 also falls back to 3 s after a failed subscribe).
  • New createScreenshotRequest builder used by RemoteControl.screenshot().
  • New ci.yml (type check, tests, build) on pull requests and pushes to main; README gets a short Conformance section.
  • No breaking API change and no version change.

Testing

  • bun run typecheck, bun test (454 pass, 28 skipped as not applicable to the browser: IME composition and rotated geometry), bun run build.
  • Replaying the key vectors with the previous routing fails 25 of 114 cases, including the missing key-up; the release-while-closed and synchronous-fetch-failure tests fail on the previous code.

Runtime

Checked live with the example app against a cloud Android device: the stream connects, a click opens an app on the device, typed letters arrive in a text field, and the ContextMenu key opens the app menu on the device (key down and up both delivered).

🤖 Generated with Claude Code

lutz-grex and others added 2 commits November 16, 2026 19:38
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lutz-grex
lutz-grex requested a review from RasulOs November 16, 2026 19:09
@lutz-grex
lutz-grex merged commit 4019ca4 into main Nov 17, 2026
1 check 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.

2 participants