Skip to content

Close the configuration node chain - #16

Open
loevgaard wants to merge 1 commit into
masterfrom
fix/close-configuration-node-chain
Open

loevgaard wants to merge 1 commit into
masterfrom
fix/close-configuration-node-chain

Conversation

@loevgaard

Copy link
Copy Markdown
Member

The tree builder chain in Configuration is never terminated — cookie_name is missing its ->end(), and so is the surrounding ->children().

It builds the correct tree today, because NodeBuilder attaches a node to its parent when the node is created, not when end() is called. So this is a latent trap rather than a live bug: append one more node to the chain and it gets attached to the scalar node instead of to children(), failing in a way that does not obviously point back at the missing end().

Verified as a no-op by diffing bin/console config:dump-reference setono_sylius_toggle_vat before and after — byte-identical:

setono_sylius_toggle_vat:

    # Whether to display prices with VAT or not by default
    display_with_vat:     true

    # Name of the cookie used to store the user's VAT choice
    cookie_name:          sstv_display_with_vat

Addresses a nitpick from #5.

https://claude.ai/code/session_01P9NzuVPQGvaVR97HZFq98a

The tree builder chain was never terminated: cookie_name is missing its ->end()
and so is the surrounding ->children(). It produces the right tree today
because nodes are attached to their parent when they are created rather than
when end() is called, so nothing was broken.

It is a trap for the next edit though. Appending another node to the chain
would attach it to the scalar node instead of to children(), which fails in a
way that does not obviously point back here.

config:dump-reference output is unchanged.

Claude-Session: https://claude.ai/code/session_01P9NzuVPQGvaVR97HZFq98a
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