Repository navigation
fix(lynx): keep readiness requests alive - #909
Merged
Merged
Conversation
Huxpro
marked this pull request as ready for review
August 30, 2026 12:14
Huxpro
marked this pull request as draft
August 30, 2026 12:19
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.
Summary
Reproduction
Lynx starts its main-thread and background scripts independently. The background transport can install its receiver and send its first correlated
main-ready-requestbefore main installs its receiver. Main's unsolicited request-0 announcement can likewise be emitted before the background receiver exists, so the current one-shot announcement retry does not guarantee that either side observes the other.The regression test creates the background transport before installing the main harness. Before this change the initial request is lost and
transport.readyremains pending. With this change the next readiness pulse reaches main, and the reply resolves the same transport without changing its correlation id.Accident history
The transport previously depended on startup scheduling making either the initial request or the single announcement-triggered retry cross the listener boundary. That was an accidental liveness guarantee: both messages can be delivered too early on Native even though listener installation is correctly ordered within each script.
#885 fixed the separate transport-materialization failure class; it did not make readiness durable. The same-id readiness/presence semantics were already exercised on Native in Huxpro/octane#233. This patch uses that verified semantic contract while rewriting the implementation around upstream's current transport lifecycle, close path, and completed-request tombstones.
Remove the failure class
This changes no protocol keys, capability rungs, first-tree behavior, main-thread implementation, D2 performance-entry code, or program/adoption surface.
getOwnPropertyNamessite auditThis PR adds, removes, or changes no
Object.getOwnPropertyNamescall. Each current Lynx site remains deliberate after #885's transport boundary:packages/lynx/src/core/protocol.ts:599— retained. It enforces dense arrays and data-property descriptors on already decoded protocol values.packages/lynx/src/core/worklets.ts:152— retained. It enforces exact enumerable data-property shapes for decoded worklet payloads and rejects accessors/symbol fields.packages/lynx/src/core/lifecycle-data.ts:109— retained. It validates lifecycle clone inputs above the decoded transport boundary, including array length handling and accessor rejection.packages/lynx/src/core/transport-codec.ts:13— documentation only, not an executable call site; retained because it records the native bridge accident that fix(lynx): serialize cross-thread transport payloads #885 removed.The upstream-state correction and validation caveats were reported before this PR in Huxpro/octane#232.
Validation
pnpm format:checkpnpm typecheckpnpm test— the unsharded local run exhausted the shared host's/tmpand file-descriptor limits (ENOSPC/EMFILE), causing 1,314 unrelated suites not to collect; the official CI shards and dedicated heavy/browser/parity jobs are the full-suite gate.packages/lynx/tests/protocol.test.tspnpm exec vitest run --project lynx— 27 files, 395 tests passedpnpm exec tsgo --noEmit -p packages/lynx/tsconfig.jsonpnpm exec tsgo --noEmit -p packages/lynx/tsconfig.testing.jsonpnpm exec tsgo --noEmit -p packages/lynx/typetests/tsconfig.jsonpnpm typecheck:files packages/lynx/src/core/transport.tspnpm syncpnpm changeset:checkgit diff --checkmain + #909@9994674bba + #886@7378d00477Native build/load — the corrected bundle exposes the expected 1000-row semantic snapshot with no application error; the leased Explorer identifies as SDK0.0.1and lacks both bare andglobalThistimer APIs, so readiness-pulse and ACK/two-frame acceptance are deliberately not claimed on that image (evidence)Risk / follow-ups
The only repeated work is one small same-id transport message every 16 ms before readiness. It stops as soon as readiness resolves or the transport closes. No D2 code is included here; #886's device acceptance will be tested as a disposable stack on top of this PR while #886 itself remains unchanged.
Provenance
agent-authored)