Repository navigation
fix(lynx): journal wire-safe props in the direct first-screen applier - #98
Merged
Merged
Conversation
The direct applier stored the rendered records' raw props, so a main-thread: event prop stayed a tagged callable inside the host record. captureLynxFirstTree snapshots record props onto the main-ready reply, and a real host's ContextProxy structured-clones that message — the callable threw DataCloneError, destroyed the page lifetime, and web-core remounted the first screen in a loop. Every fake-environment transport passes objects by reference, which is why only the real-browser web-host suite caught it. Clone props through the staged applier's cloneProps at direct-apply time, unwrapping tagged callables to their plain worklet descriptors and rejecting anything structured clone would refuse. The differential first-screen suite now renders a main-thread:bindtap tagged callable and pins that both appliers journal the descriptor, never the function. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0177Jx2vUB9w1hS9AYGmFkWw
Huxpro
marked this pull request as ready for review
August 19, 2026 18:26
Huxpro
pushed a commit
that referenced
this pull request
Aug 20, 2026
Picks up #98's wire-safe prop journalling in the direct first-screen applier, which the stack branched before. Without it `web-host.test.ts` fails: a `main-thread:` event prop stays a tagged callable in the snapshot that crosses the ContextProxy wire. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
5 of 6 tasks
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
new-lynxCI failure (web-host.test.ts > publishes a main-thread handler flush without faulting the Web host) introduced by the L3 direct-emission first screen (feat(lynx): direct-emission first screen with unchanged adoption capture (issue-58 L3) #65).applyLynxFirstScreenDirectnow clones each host's props through the staged applier'sclonePropsbefore journaling them, somain-thread:tagged callables become their plain worklet descriptors and anything structured clone would refuse is rejected at apply time.Why
The direct applier stored the rendered records' raw props. A
main-thread:bindtapprop therefore stayed a tagged callable inside the host record;captureLynxFirstTreesnapshots record props onto themain-readyreply, and a real host's ContextProxy structured-clones that message. The callable threwDataCloneError: Failed to execute 'postMessage' on 'MessagePort', web-core destroyed the page lifetime, and the first screen remounted in a loop — the "Tap to flush" probe was never clickable. Every fake-environment transport passes objects by reference, which is why the 344-test lynx project and the differential suites stayed green and only the real-browser suite caught it. Bisect: green at #64's head, red at #65's first commit.Changes
packages/lynx/src/core/host-driver.ts: the direct walk clones props viacloneProps(same call the stagedcreatepath makes at command-prepare time) instead of retaining the raw record props.packages/lynx/tests/first-screen-direct.test.ts: the differential fixture now carries amain-thread:bindtaptagged callable (registered worklet + per-container registries), and the snapshot assertion pins that both appliers journal the plain{_wkltId, _c}descriptor, never the function. Red-green verified: without the fix the direct snapshot holds[Function rowTapMTS].Validation
pnpm format:fileson touched files;pnpm synccleanpnpm typecheck:fileson touched files (clean)pnpm test(full repo run not repeated for this diff; the prior full run's only non-environmental failure is exactly this suite)packages/lynx/tests/first-screen-direct.test.ts4/4 (red-green verified); fulllynxproject 344/344; real-browserpackages/rspeedy-plugin-octane/tests/browser/web-host.test.ts3/3 — previously the main-thread-flush case timed out after 30s of first-screen remount churn, now passes in ~7s.Risk / follow-ups
clonePropsreintroduces one props clone per first-screen host on the direct path (scalar fast path for typical hosts). Re-measure the L3 FCP number on the benchmark harness before quoting it; tracked as part of L3 (#58): main-thread slot-table applier + first-screen create-function codegen in @octanejs/lynx #62's remaining slices.Provenance
agent-authored)Generated by Claude Code