Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
The connection between the Harness CLI and the app now runs over the multiplexed WebSocket link from simlock. Previously, RPC messages and screenshot bytes shared one WebSocket with no ordering or flow control: a large screenshot went out as a single binary frame, and the CLI held it in memory until a separate RPC call claimed it. This PR replaces that transport. The RPC protocol and the public
connectToHarness/createHarnessBridgeAPIs stay the same.How does it work?
The link wraps one WebSocket and carries two kinds of traffic:
readymessage and heartbeat ping/pong. They travel in a priority lane.ReadableStream/WritableStreampairs, sent in 64 KiB frames with per-channel credit. A screenshot is written into a channel, and the RPC call carries only the channel id. The CLI accepts the channel, reads it to the end and writes the file.The link lives in
packages/bridge/src/link/. It is a copy of simlock'ssrc/linkatb730ef3plus a standard-WebSockettransport used on both ends: overwsin the CLI, and over the platformWebSocketin the app. The copy stays close to upstream, and each local change is marked with aharness:comment.link/README.mdexplains each change; most are for React Native:web-streams-polyfillponyfill without installing globals, leaving the app under test unchanged.WebSocketnever setsbufferedAmount, so a missing value counts as0.TextEncoder/TextDecoder.crypto.randomUUID.The upstream link tests come along with it, plus tests for the React Native conditions above and an end-to-end screenshot transfer between
createHarnessBridgeandconnectToHarness.Why is this useful?
Test events and heartbeats no longer queue behind screenshot data, and large binary payloads stream with backpressure instead of landing in memory as one frame. Byte channels also give the bridge a general way to move binary data in either direction, so future features such as files or other artifacts do not need a new ad hoc frame format. The CLI and the app runtime must run the same Harness version, because the wire protocol has changed.