question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:open
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lvegeranocommented, Apr 7, 2021

@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? 🤯

0reactions
lvegeranocommented, Apr 9, 2021

Thanks for your input @bertdeblock. The RFC certainly makes it sounds as if this is the intended behavior 🤷🏾‍♂️ .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found