-
Notifications
You must be signed in to change notification settings - Fork 159
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
Ensure initial transition can be aborted then retried. #213
Ensure initial transition can be aborted then retried. #213
Conversation
cf8a0b7
to
f1a83bf
Compare
f1a83bf
to
7ba0712
Compare
When the initial transition is aborted and subsequently retried, the `urlMethod` of `null` was being inherited. This meant that upon retry, the URL would never be updated.
@alexspeller @cibernox - This fixes emberjs/ember.js#15190 (if y'all are curious to the root cause). |
// inherited for a new transition because then | ||
// the url would not update even though it should | ||
if (this.urlMethod !== null) { | ||
newTransition.method(this.urlMethod); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused actually. I thought that the urlMethod
could be either update
or replace
. Under what circumstances is it null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cibernox - It is null
only for the very first initial transition. The reason for this, is that the browser has already updated the window.location
and we are basically just telling the system to update its internal state to match the current URL. The docs for Router#handleURL
explain it a bit also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I think it may be better to just add another flag for this to the Transition object. That way the urlMethod
doesn't need to play double duty, and its much more obvious what is going on...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I didn't realize urlMethod could be null, but now that I do, this makes total sense and is a good fix
Attempting to recreate the scenario identified in emberjs/ember.js#15190.