Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router state is Mutable via ActivatedRouteSnapshot #27528

Open
the-avid-engineer opened this issue Dec 7, 2018 · 7 comments
Open

Router state is Mutable via ActivatedRouteSnapshot #27528

the-avid-engineer opened this issue Dec 7, 2018 · 7 comments
Labels
area: router P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone

Comments

@the-avid-engineer
Copy link

馃悶 bug report

Affected Package

@angular/router (probably)

Is this a regression?

No. It appears to have existed for a while. See #17609

Description

If you mutate existing properties on the queryParams object of an ActivatedRouteSnapshot without making a deep copy, it appears to mutate the router's internal state. Telling the router to navigate using the mutated queryParams object does not trigger a navigation event in this case.

馃敩 Minimal Reproduction

https://stackblitz.com/edit/github-powged?file=src%2Fapp%2Freproduction%2Freproduction.component.ts

@the-avid-engineer
Copy link
Author

Ideally the fix would be to automatically return a deep copy of the queryParams object, so that you can't fall into this trap

@the-avid-engineer the-avid-engineer changed the title Route state is Mutable via ActivatedRouteSnapshot Router state is Mutable via ActivatedRouteSnapshot Dec 7, 2018
@alxhub alxhub added type: bug/fix feature Issue that requests a new feature area: router and removed type: bug/fix labels Dec 11, 2018
@ngbot ngbot bot added this to the Backlog milestone Dec 11, 2018
@jasonaden
Copy link
Contributor

Thanks for the issue. I scheduled to take a deeper look into this shortly after the holidays. It appears there are a number of people having similar issues so I'll see what we can do to get a resolution in place for it.

@the-avid-engineer
Copy link
Author

Is there any update on this issue?

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Jun 4, 2021
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 4, 2021

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 27, 2021

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Jun 27, 2021
@atscott atscott added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed feature Issue that requests a new feature feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase labels Jul 23, 2021
@mebibou
Copy link

mebibou commented Oct 4, 2023

I fell into this trap as well. It did work at some point as I didn't have this issue before I upgraded to Angular 16 (but was migrating from 14)

@the-avid-engineer
Copy link
Author

the-avid-engineer commented Oct 7, 2023

@mebibou @stonetwig @troehling

Please give this issue a 馃憤 if you want it fixed .. I opened this issue almost five years ago, it hasn't been worked on due to lack of votes :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: router P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants