A freshly added Switch fails the run instead of routing #29
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Adding a Switch to a route and running the automation failed the step:
BuiltInControlDescriptorsseeded the Switch's first branch with the expressionitem.value == true. The editor copies schema defaults verbatim when an action is added, so every new Switch carried that condition, and any incoming record without avaluekey — which is most of them — failed the node outright rather than routing. The workflow broke until the author happened to replace the condition.Swapping a condition to expression mode in the editor seeded the same placeholder.
Predates #12; typed conditions did not introduce it.
Scope
Resolution
Fixed on
mainin096863b. The default is now the expressiontrue: a new branch matches everything until the author narrows it, which is understandable and cannot fail. The descriptor callsencodeSwitchConditionrather than embedding the JSON shape by hand, so it stays the canonical encoded form rather than the legacy bare string.Covered by
SwitchDescriptorDefaultsTest, which asserts both that a default switch routes rather than failing and that the stored form is canonical. Verified on a Pixel 9 emulator by asking the app for its own descriptor default and running a workflow built from exactly that: the record routes tocase:matching, fallback empty.