PR_26175_DELTA_002: consolidate replay runtime cloning#182
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27f185b26e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| recordFrame(frame) { | ||
| if (this.recording) { | ||
| const clonedFrame = structuredClone(frame); | ||
| const clonedFrame = cloneRuntimeValue(frame); |
There was a problem hiding this comment.
Route timeline snapshots through the fallback clone
When structuredClone is unavailable, this new fallback clone lets recordFrame create clonedFrame, but the same call immediately passes that frame into ReplayTimeline.pushSnapshot, which still calls the global structuredClone and throws TypeError: structuredClone is not a function. This means recording still breaks in the exact fallback environment covered by the new test; I confirmed with node ./scripts/run-node-test-files.mjs tests/replay/ReplaySystem.test.mjs.
Useful? React with 👍 / 👎.
Summary
cloneRuntimeValue(...)to the shared runtime snapshot helper.structuredClonecalls.structuredClone.Validation
node --check src/shared/runtime/snapshotClone.jsnode --check src/engine/replay/ReplayModel.jsnode --check src/engine/replay/ReplaySystem.jsnode --check tests/replay/ReplaySystem.test.mjsnode tests/replay/ReplaySystem.test.mjsnode tests/final/FinalSystems.test.mjsgit diff --checkArtifact
tmp/PR_26175_DELTA_002_Shared_Runtime_Consolidation_delta.zipNotes