-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
QP only transition in beforeModel of application route throws error #11563
Comments
👍 I created two failing tests for this I went ahead and created failing tests in both the default code path and in the This also fails in the model hook, I've only tried those two hooks so far. Anyone know whats up with that feature-flag? Its not in the FEATURES.md yet... |
This bug is pretty tricky because its caused by interaction between tildeo/router.js and ember.js/route. When router.js is doing a queryParamTransition it generates an empty Transition because it should be a no-op transition. But ember.js/route needs to know the leaf node so that it can lookup the query params on the controller and do all its magic. When ember.js/route#finalizeQueryParamChange finally gets called, the transition passed to it contains no information about the current route, So it really seems like the fix should go in tildeo/router.js, probably around this line: https://github.com/tildeio/router.js/blob/master/lib/router/router.js#L126 If we did something like:
I think that might fix it, but I'm not sure if that would break anything else; |
Actually that doesn't fix it. Even if you get the |
This is definitely caused by the fact that Got to love the comments here: https://github.com/emberjs/ember.js/blob/v2.5.0/packages/ember-routing/lib/system/route.js#L1182-L1183 |
I can't tell if this is still an ongoing issue. Anyone have time to create a demo app or twiddle to confirm? |
I just hit this as well in Ember I also believe that I found a "fix", but tbh I have no clue what's going on with - let newTransition = new InternalTransition(this, undefined, undefined);
+ let newTransition = new InternalTransition(this, undefined, newState); |
@rwjblue I think this specific use case is working on the last release (3.25.1), because this looks a lot like this: #17494 (comment) Update, seems like I spoke too fast. I've reproduced the use case of the original @raytiley example here: https://github.com/sly7-7/repro-ember-17494/tree/derived-from-ember-11563 It appears that on current release, the error is catched, but after closing the alert, the state seems good. |
Reproduction: http://emberjs.jsbin.com/verocu/2/edit?html,js,output
Our app does some
beforeModel
checking of data to see what "location" the user is operating. If know query param for this is provided calltransitionTo
in order to force the user is at a location.Because of some other logic I just added a
catch
to the promise chain that thetransitionTo
is a part of. Now I'm noticing the error shown in the above jsbin.Interesting thing when trying to recreate is that if you have no
catch
on the promise chain and the QP is setrefreshTrue
then a second transition will fire, will have the correct query param and so the user won't notice the failure.The text was updated successfully, but these errors were encountered: