You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Redesign NGSwitchComponent as dynamic component references — keyed, not path-faked #47
changed the title [-]Implement SwitchComponent[/-][+]Redesign NGSwitchComponent as dynamic component references — keyed, not path-faked[/+]on Aug 22, 2026
Repurposing this issue (2026-08-22): the switch component exists (NGSwitchComponent, based on ERXWOSwitchComponent) — what remains is fixing its design.
The mechanism today is elementID path-faking: each distinct component name is assigned a number on first use, and the switch fakes a structural elementID branch (addBranchAndSet) around every phase to keep per-case component instances and senderIDs apart. Two problems with that:
ID minting had a check-then-act race — fixed in 760de94 (atomic minting via computeIfAbsent).
IDs are minted in first-encounter order, so the name→ID mapping is traffic-dependent across JVM restarts and app instances. Harmless today only because sessions are in-memory; becomes silent wrong-component action dispatch under persistent sessions (Session resurrection: framework support for rebuilding sessions across restarts #49) or cross-instance session sharing. Documented in a FIXME on the field.
The redesign: dynamic component names should be a capability of the component reference itself (<wo:component name="$componentName">), with per-case child instances kept apart by keying, not path-faking — the child-instance key becomes (elementID, resolved name) instead of a mutated elementID path. That removes the global name→ID registry, the ordering dependence, and the element-level mutable state in one stroke. Composes with the action-references/render-receipts direction, under which elementID-stability tricks stop mattering entirely.
Activity
NGSwitchComponent: fix elementID-minting race, document the ordering …
[-]Implement SwitchComponent[/-][+]Redesign NGSwitchComponent as dynamic component references — keyed, not path-faked[/+]hugithordarson commentedon Aug 22, 2026
Repurposing this issue (2026-08-22): the switch component exists (
NGSwitchComponent, based on ERXWOSwitchComponent) — what remains is fixing its design.The mechanism today is elementID path-faking: each distinct component name is assigned a number on first use, and the switch fakes a structural elementID branch (
addBranchAndSet) around every phase to keep per-case component instances and senderIDs apart. Two problems with that:ID minting had a check-then-act race— fixed in 760de94 (atomic minting via computeIfAbsent).The redesign: dynamic component names should be a capability of the component reference itself (
<wo:component name="$componentName">), with per-case child instances kept apart by keying, not path-faking — the child-instance key becomes (elementID, resolved name) instead of a mutated elementID path. That removes the global name→ID registry, the ordering dependence, and the element-level mutable state in one stroke. Composes with the action-references/render-receipts direction, under which elementID-stability tricks stop mattering entirely.