Skip to content

fix(studio): wire onTrySdkPersist to sdkCutoverPersist (cutover was unwired)#1463

Open
vanceingalls wants to merge 1 commit into
06-15-feat_studio_s7.5_remove_sdk_shadow_cutover_feature_flags_make_cutover_always-onfrom
06-15-fix_studio_wire_ontrysdkpersist_to_sdkcutoverpersist_cutover_was_unwired_
Open

fix(studio): wire onTrySdkPersist to sdkCutoverPersist (cutover was unwired)#1463
vanceingalls wants to merge 1 commit into
06-15-feat_studio_s7.5_remove_sdk_shadow_cutover_feature_flags_make_cutover_always-onfrom
06-15-fix_studio_wire_ontrysdkpersist_to_sdkcutoverpersist_cutover_was_unwired_

Conversation

@vanceingalls

@vanceingalls vanceingalls commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

What

Stage 7 s7.5 declared the SDK cutover "always-on" by removing the feature flag, but
onTrySdkPersist was never actually passed to useDomEditCommitssdkCutoverPersist was
dead code in production. Every DOM edit still went through the server patch path.

This PR wires the cutover for the op types already supported by sdkCutover.ts:
inline-stylesetStyle, text-contentsetText, attribute/html-attributesetAttribute.

Why

Without this wiring, Stages 3.1–3.5 (delete, timing, GSAP panel) have no foundation to build on.
Also fixes a correctness gap: s7.5 said cutover was active but it wasn't.

How

  • Added sdkSession?: Composition | null to UseDomEditSessionParams
  • In useDomEditSession, imported sdkCutoverPersist and built an onTrySdkPersist closure
    using deps already in scope (editHistory, writeProjectFile, reloadPreview, domEditSaveTimestampRef)
  • Passed sdkSession from App.tsx into useDomEditSession (all other CutoverDeps were already threaded)
  • onTrySdkPersist is undefined when sdkSession is null/absent — no behavior change without a session

App.tsx is exactly 600 lines (at the Studio file-size gate limit).

Test plan

  • bun run build — passes (all packages)
  • bun run test in packages/sdk — 226/226 pass
  • bun run test in packages/studio — 3 pre-existing failures in useDomEditSession.test.ts
    (stale test calling shouldUseSdkCutover with a now-removed flag param); all other tests pass
  • bunx oxlint + bunx oxfmt --check — no warnings or errors on changed files
  • Pre-commit hooks (filesize, lint, format, fallow, typecheck) — all pass
  • Manual Studio smoke: style/text edit → confirm sdk_cutover_success telemetry fires (not _fallback)

…nwired)

Stage 7 s7.5 removed the feature flag and declared cutover 'always-on',
but onTrySdkPersist was never actually passed to useDomEditCommits — the
sdkCutoverPersist function was dead code in production.

Thread sdkSession through useDomEditSession params, build the
onTrySdkPersist closure there (all CutoverDeps are already in scope),
and pass sdkSession from App.tsx. Style/text/attribute/html-attribute
commits now route through SDK dispatch instead of the server patch path.

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant