-
-
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
Router redirects should not abort transactions #3056
Comments
👍 |
This seems good. I guess this is how pre-facelift stuff worked, right? |
On redirect, we should likely, fulfill with something that correctly conveys final resting point. To support something like "abort" or "unauthorized", the rejection case may be valid. If that is decided, we may want to explore throwing specific routing errors (ala Router.ForbiddenError or Router.UnauthorizedError). The key being, if we overload the rejections for both exceptional and flow control, we must still be able to distinguish the difference, and handle/swallow/report accordingly. (@machty I edited my comment, hopefully it is slightly more coherent) |
@stefanpenner i don't quite follow your comment about Router.Forbidden... say more? |
@stefanpenner, @machty This seems like a big issue. What's the plan to address this? |
As i mentioned in the call, this is a very blanket and not totally accurate issue, and many of the instances of this are already fixed. I need some more specific examples when this does not work (and there are some examples in other issues that I'll be working on over the next few days). But just so we're clear, it's not like this is the definite behavior for all transitions; afaik, there's just a few more corner cases to nail. |
@machty, any more recent thoughts on this? |
The latest on this is what I wrote here |
I can say pretty confidently that this will entirely cease to be an issue with my router.js refactor. |
This is megafixed via #4008 |
If this issue was fixed at some point, it seems like there might have been a regression. I've run into the same behavior described in #3163. I have a transitionTo the login page in my application route's model hook which conditionally fires if an ajax request says the user is unauthenticated. It's a fairly simple scenario without any query params or anything. On page load, the application route hooks get called twice, once on the initial transition and again after the first transition is aborted by redirecting to the login page. The transition log looks like this:
|
@Bargs I am facing the same issue, Were you able to resolve it? |
I believe I had to work around it by saving a variable on the first load that I could conditionally check for to avoid taking actions on the second load. I don't work on this application anymore though so I don't know if it's been fixed in future versions. |
@Bargs Thanks! |
I am seeing this behaviour on routes as well. env: on build cli 3.13.2 node 12.14.0 and os lunix x64 |
This means that even if the redirect is in the same tree we have to exit and re-enter all of the parents.
The text was updated successfully, but these errors were encountered: