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.

Router service: Failing with query parameters on application controller

See original GitHub issue

Hello,

I’m not really sure what’s really the problem here. Anyway, when trying to migrate to the router service I got a strange error message. I’ve distilled it down to the following minimal test case:

  • The application controller has a query parameter
  • I’ve got two routes, route A uses the router service to transition to route B in afterModel
  • I’ve got an acceptance test that loads route A with the query parameter set

This leads to “Assertion Failed: You passed the application:testParam query parameter during a transition into application, please update to testParam”.

The checkin leading to this behaviour can be found here: https://github.com/jnfingerle/emberjs-issue-16594/commit/5b86444f1a5e68604be14542e36dc22c0128dcff

I believe this to be a bug. If the problem should be in my code, a hint would be helpful.

Cheers, Jan Niklas

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
st-hcommented, Aug 7, 2019

@snewcomer I took some time to look into this, and I don’t think cleansing is the reason here:

in @ember/-internals/routing/lib/system/router.js:_hydrateUnsuppliedQueryParams() has a property _fromRouterService. This property essentially makes the assertion we see fail, as it is the only thing that differs when using the router service.

This value is previously called _keepDefaultQueryParamValues in @ember/-internals/routing/lib/system/routerjs:doTransition() when not using the router service.

When using the router Service it is always set to true.

I still have troubles understanding the actual meaning of what the assertion is trying to tell me. And I can’t really figure out the reasoning behind the variable called _fromRouterService - unfortunately this also is the only undocumented param. I’ll try and see if I can find someone who can shed some light into how things are supposed or intended to be.

0reactions
st-hcommented, Aug 8, 2019

@rwjblue I was going through the history of @ember/-internals/routing/lib/system/router.js as I was unable to find anyone who would be able to help me with details about the router, and it seems that your name shows up next to the assertion, I can not make any sense of. Would you have some time to help fix this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query string not working while using attribute routing
I was facing the same issue of 'How to include search parameters as a query string?', while I was trying to build a...
Read more >
Accessing query params in application route, or in ... - Ember.JS
I have an app that relies on a query param in the application route, which determines which data to load throughout. Let's call...
Read more >
Model Binding in ASP.NET Core | Microsoft Learn
Model binding goes through the following steps after the routing ... Parameters of the controller action method that a request is routed to....
Read more >
Listeners for your Application Load Balancers
For more information, see Request routing in the Elastic Load Balancing User Guide. Listener rules. Each listener has a default rule, and you...
Read more >
Router - Angular
A service that provides navigation among views and URL manipulation capabilities. ... How to merge parameters, data, resolved data, and title from parent...
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