Repository navigation
fix(workflow-code): store a raw() branch value as json text when it lifts into rows - #10608
Open
waleedlatif1 wants to merge 1 commit into
Open
waleedlatif1 wants to merge 1 commit into
waleedlatif1 wants to merge 1 commit into
Conversation
…ifts into rows A condition/router branch written as raw([...]) was stored as a native array. The condition editor reads branches with toString() and JSON.parse, so it saw "[object Object]", fell back to default rows, and the next edit overwrote the real conditions. A branch value that lifts into rows (the shape the editor parses) is now written as JSON text, as before #10527. A value that does not lift (retired native rows) stays as written, so the printed raw(v) reads back unchanged and re-applying it stays a no-op.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge. SummaryThe PR stores liftable
No actionable issues were found. Review checks were read-only; tests were not run.
|
This branch was previously deployed
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
raw([...])was stored as a native array (follow-up to fix(workflow-code): keep stored values an unchanged source round trip used to rewrite #10527). The condition editor reads branches withtoString()+JSON.parse, got"[object Object]", fell back to default rows, and the next edit overwrote the real conditions.raw()branch value that lifts into rows (a list of{ id?, title?, value }rows with distinct ids: the shape the editor parses) is now written as JSON text, asforceTextdid before fix(workflow-code): keep stored values an unchanged source round trip used to rewrite #10527. A value that does not lift, such as retired native{ id, next, label, expression }rows, stays as written, so the printedraw(v)reads back unchanged and re-applying it is still a no-op.liftsIntoRowspredicate sits next toliftBranchesincanonicalize/branches.ts, andParamSite.verbatimbecomesParamSite.branch({ kind, blockId }), which the derived row ids need.The first approach ("native only over a stored native value") broke the round-trip corpus property apply printed source as a new workflow, then re-apply as a no-op: retired native rows were stored as text and then printed as
raw('…'), so they never settled. Deciding by liftability keeps that property.Tests
editing.corpus.test.ts:raw([...rows])over a stored''is stored as JSON text. This test fails on staging withexpected 'object' to be 'string'.@sim/workflow-codesuite (835 tests) passes, along withlib/workflows/codeand the editing/roundtrip/generate corpus suites (including the stored-shapes fixtures).