Skip to content

fix(lynx): journal wire-safe props in the direct first-screen applier - #98

Merged
Huxpro merged 1 commit into
new-lynxfrom
fix/lynx-direct-first-screen-wire-props
Aug 19, 2026
Merged

Huxpro merged 1 commit into
new-lynxfrom
fix/lynx-direct-first-screen-wire-props

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes the new-lynx CI 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).
  • applyLynxFirstScreenDirect now clones each host's props through the staged applier's cloneProps before journaling them, so main-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:bindtap prop therefore 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: 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 via cloneProps (same call the staged create path 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 a main-thread:bindtap tagged 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:files on touched files; pnpm sync clean
  • pnpm typecheck:files on 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)
  • targeted tests: packages/lynx/tests/first-screen-direct.test.ts 4/4 (red-green verified); full lynx project 344/344; real-browser packages/rspeedy-plugin-octane/tests/browser/web-host.test.ts 3/3 — previously the main-thread-flush case timed out after 30s of first-screen remount churn, now passes in ~7s.

Risk / follow-ups

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

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
Huxpro marked this pull request as ready for review August 19, 2026 18:26
@Huxpro
Huxpro merged commit d06deca into new-lynx Aug 19, 2026
20 of 21 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant