Skip to content

Consider throwing error when adding routes to consumed trie #311

@coderabbitai

Description

@coderabbitai

Context

When a trie is attached using attachAndConsume, the trie is consumed and subsequent modifications to it are not reflected in the parent trie. Currently, adding routes to a consumed trie after attachment is a silent no-op.

Enhancement Request

Consider throwing an error when attempting to add routes to a consumed trie to make it apparent that the operation has no effect.

References

Related Code

trieB.add(NormalizedPath('/'), 1);
trieA.attachAndConsume(NormalizedPath('/api'), trieB);

// Add a new route to trieB after attachment
trieB.add(NormalizedPath('/new'), 2);  // This is currently a no-op

The suggestion is to throw an error at this point to make the no-op behavior explicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routingIssues related to routing.uxIssues related to the user experience working with Relic.

    Type

    No type

    Projects

    Status

    Backlog 🗂️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions