Repository navigation
fix(core): editors and preview runtimes from different releases can edit together again - #9046
Conversation
…dit together again Reverts the handshake change that had Studio make the editing channel and send the frame one end. Every published release asks and lets the runtime make the channel; a page loads whichever runtime its link names, so an older editor could no longer edit a newer runtime, or the reverse.
Edit accuracy: accurate 275 (base branch 273), smooth 72 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
terencecho
left a comment
There was a problem hiding this comment.
The PR names cross-release regression tests in both directions and retains the page lifecycle notices and pointer-watch cleanup. The revert also removes the preview editing-channel ownership protection introduced in #9000. Please keep that protection in the compatibility change, so both guarantees ship together.
— tai (automated review)
terencecho
left a comment
There was a problem hiding this comment.
I checked against the published 0.9.104 runtime. The restored handshake matches it, but sealed drag is still incompatible with that runtime. In packages/studio/src/components/editor/previewDrafts.ts:97, Studio adds chrome to the same draft request as the element movement. The 0.9.104 runtime accepts exactly the drafts key and rejects the entire request when chrome is present. The cross-release handshake test does not exercise this Studio drag path. Please preserve the legacy draft payload when the runtime lacks chrome support and cover a cross-release sealed drag.
— tai (automated review)
…ent again A sealed drag sends the frame its selection outline with each draft, which runtimes before that change refuse whole, so the element stayed put. The runtime now says in hello that it takes the outline, and Studio sends it only to a runtime that said so.
|
Both points from the review, at the new head: The drag outline and older runtimes. Right: a sealed drag sent I compared every request Studio sends against 0.9.104's request types. fails without the fix: In Chrome, the real published 0.9.104 and 0.9.54 runtimes answer "not taken", and they refuse a draft carrying The rule that keeps a preview's channel to its own page. This PR deliberately takes it out, together with the handshake change it was part of. #9038 brings it back on top of this PR, built so that it works with released runtimes, and it ships in the following release. |
terencecho
left a comment
There was a problem hiding this comment.
The compatibility issue is resolved. A runtime that does not advertise draft chrome continues to receive the legacy draft payload, and Studio keeps drawing the outline. The new regression covers that path, including the old runtime rejecting any draft that carries the extra field. I reviewed this delta against the published handshake. Static re-review.
— tai (automated review)
What
The preview's editing channel speaks the handshake every published release uses again: Studio asks, and the runtime makes the channel and posts its end back. An editor from 0.9.54 through 0.9.104 can edit a page on this runtime, and this Studio can edit a page whose runtime comes from those releases.
Why
#9000 changed the handshake (Studio made the channel, sent the frame one end and bumped the protocol to 2), so Studio and the runtime had to come from the same release. Editors pin a release while a page loads whichever runtime its link names, so a page on a newer runtime could not be edited from an older editor, and the reverse. No published release speaks the new handshake, so going back to the released one breaks nothing that shipped.
Related work
Reverts #9000. The page-shown and page-left notes from #9007 stay: they don't depend on how the channel is made. #9038 builds the channel rule that keeps a preview's channel to its own page on top of this.
How
core/src/runtime/editingAgent.ts,editingPort.ts,runtimePort.ts: fix(studio): make the preview's editing channel in Studio and send the frame one end #9000 reverted: the runtime answers aediting-connectfrom its parent with a channel it makes, postingediting-port(version 1) with one end; the client asks and takes that port.announcePageLifefrom fix(studio): a preview frame that loads another page itself gets no editing channel #9007 is kept as it was.core/src/runtime/entry.ts: the runtime announces its page as before; the listener fix(studio): make the preview's editing channel in Studio and send the frame one end #9000 added at evaluation goes with the rest of that handshake.core/src/runtime/editingPort.releases.test.ts: the released handshake written out literally, both directions, so a future change to it fails here.Test plan
fails without the fix:
packages/core/src/runtime/editingPort.releases.test.ts("serves a released editor's connect on this runtime, and answers its requests", "edits a page on a released runtime, which answers the connect with its own port"): both red onmain, green with the change.Ran at this head: the core suite, the Studio suite and the producer's editing port test, both type checks and the repo hooks; the new test file 3 runs in a row. In Chrome, with the editing client and runtime from the published 0.9.54 and 0.9.104 packages paired with this branch's: each pair connects and moves an element (hello, query, gesture start, draft, keep), in all four pairings; the same four pairings against
maintime out.No visible change
Editing works as before; only which versions can edit each other changes.