Skip to content

fix(router): Ensure createUrlTree does not reuse segments of input#66297

Merged
kirjs merged 1 commit intoangular:mainfrom
atscott:segmentsarrayreuse
Jan 6, 2026
Merged

fix(router): Ensure createUrlTree does not reuse segments of input#66297
kirjs merged 1 commit intoangular:mainfrom
atscott:segmentsarrayreuse

Conversation

@atscott
Copy link
Contributor

@atscott atscott commented Jan 2, 2026

Mutating the UrlTree that is returned by createUrlTree can cause the input, which might even be an active route, to be mutated. This ensures the UrlSegments are recreated and do not mutate the input.

fixes #54624

Mutating the `UrlTree` that is returned by `createUrlTree` can cause the
input, which might even be an active route, to be mutated. This ensures
the `UrlSegment`s are recreated and do not mutate the input.

fixes angular#54624
@atscott atscott added area: router target: patch This PR is targeted for the next patch release labels Jan 2, 2026
@ngbot ngbot bot added this to the Backlog milestone Jan 2, 2026
@atscott atscott requested a review from JeanMeche January 5, 2026 17:57
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Jan 5, 2026
@kirjs kirjs merged commit 39efb62 into angular:main Jan 6, 2026
23 checks passed
@kirjs
Copy link
Contributor

kirjs commented Jan 6, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: router target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Router.createUrlTree(...) creates new UrlTree which reuses UrlSegmentGroups from the Router.currentUrlTree

3 participants