[Bug] Default queryParams are not getting pruned
See original GitHub issue🐞 Describe the Bug
Transitioning to from a parent route with queryParams to a child route with queryParams using the router service, fails to prune default queryParams leaving the URL in an undesired state
🔬 Minimal Reproduction
https://github.com/lvegerano/ember-qp-prune-fail
😕 Actual Behavior
Having the following routes:
- main
- route-a
main
has a queryParams
queryParams = [
{
labelIds: {
type: 'array',
as: 'l',
},
},
];
routing to main.route-a
using the router service adds the serialized array brackets to route-a
URL
http://localhost:4200/main/route-a?l=%5B%5D
🤔 Expected Behavior
The URL does not contain the default value of the queryParam
http://localhost:4200/main/route-a
🌍 Environment
- Ember: - 3.25.3
- Node.js/npm: - 3.25.3
- OS: - Mac/Windows WSL
- Browser: - Chrome 89
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
[3.6+] Query Params behavior changes with RouterService ...
When query params do not have refreshModel: true set, using RouterService#transitionTo ultimately results in query params being removed from ...
Read more >Default query params not getting passed in axios request
I solved it using 2 ways: Using default params and spreading them when using the request export const API_DEFAULT_PARAMS = { part: 'part', ......
Read more >Amazon Aurora PostgreSQL parameters
Viewing Aurora PostgreSQL DB cluster and DB parameters. You can view all available default parameter groups for RDS for PostgreSQL DB instances and...
Read more >Cisco Firepower Release Notes, Version 6.6 - Open and ...
Resolved Bugs in Version 6.6.5 ; CSCvv44863. Failure to load default threat category setting from URL filtering configuration file ; CSCvv49698.
Read more >use-query-params - npm
By default, use-query-params uses URLSearchParams to handle interpreting the location string, which means it does not decode null and has ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bertdeblock It also happens in 3.14. Reading the RFC you are correct. Its terrible DX. How is it ok to have different behaviors when transitioning to a route? 🤯
Thanks for your input @bertdeblock. The RFC certainly makes it sounds as if this is the intended behavior 🤷🏾♂️ .