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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router transition.retry with dynamic segments and refreshModel queryParams causes unexpected error #16992

Open
rafaelbnp opened this issue Sep 19, 2018 · 3 comments

Comments

@rafaelbnp
Copy link

Seems related to #10945.

My use case is: when a user tries to navigate with an expired token (by leaving the window open long enough) the API calls will fail with a unauthorized error. We added some logic to the Applications's error action to catch this type of error, re-authenticate the user and retry the transition after the authentication. The problem is that when I try to transition.retry() to a route with dynamic segments and query parameters with refreshModel, it will fail with the below error:

You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route [route name]

If I set my query param to refreshModel: false, it works fine.

Here's a reproducible twiddle: https://ember-twiddle.com/e25fc434b6e1c1627e553b8120203655?openFiles=routes.dynamic-segment.js%2C
You can see the error when clicking on the 'Dynamic segment with query param' link. If you change the refreshModel to false on /routes/dynamic-segment.js it works.

Any help is appreciated. Thanks!

@tpetrone
Copy link

tpetrone commented Jul 26, 2019

I am experiencing something similar when trying to transition.retry() a Transition that was triggered by a Route.refresh() where queryParamsOnly: true

I guess this is somehow related to #16921

@krukid
Copy link

krukid commented Nov 11, 2020

I find that Route#refresh() produces a transition that cannot be retried if there are dynamic segments.

Here's my use case: https://ember-twiddle.com/6d2f981f6628a3260db8cafd3b3aac0a?openFiles=routes.flopping-route%5C.js%2C

@rwjblue
Copy link
Member

rwjblue commented Nov 11, 2020

@krukid - The issue you mention seems somewhat unrelated to the original one being discussed here (I think). Would you mind filing a new issue for that?

@rreckonerr recently fixed a somewhat related bug (where we would not thread through the original values when doing intermediate transitions), this seems somewhat related. I think the first step here would be to make a failing test case over in router.js...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants