-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
"apply the history step" fails if multiple sync navigations happened #10232
Comments
@jakearchibald or @domfarolino, would you be able to help with this one? Or @kalenikaliaksandr, do you have any suggestions for a fix? |
as I see it could be solved by adding following steps in "URL and history update steps":
not sure how to describe the first step in spec terminology though. |
I assume you mean 12.4 is indeed at least reached, but just that its substeps are not run because the condition it poses fails?
Can you clarify whether you think the assertions fail during the first "apply the history step" invocation, or the second one? I think from reading only "apply the history step", I would think that assertions could fail during the first time "apply the history step" runs. For example: history.pushState(…);
history.pushState(…);
history.pushState(…); By the time the first "apply the history step" finally asynchronously runs for the first time, step 12's displayedEntry and targetEntry are both sufficiently different such that we would not satisfy the 12.4 condition:
... and we would accidentally continue to 12.5 and fail this assert:
But I don't think that "apply the history step" would ever even run for the first
So the only time "apply the history step" would actually run during all of these With that said, even if my analysis is correct (which it might not be), we still might have an issue. Above, I propose that things are "fine" in the case where we do a bunch of synchronous back-to-back pushStates()s, but it's possible for the following sequence of events to happen:
This could cause the failed assertions that I think you're concerned about. Do you agree with all of this? |
@domfarolino my bad, let me describe steps to reproduce in more details. let's assume all steps are execute within one thread:
yes, I meant this condition is evaluated to false.
it fails during the first invocation.
correct.
it won't silently die if finalize a same-document navigation is executed between the first and second history.pushState() invocations.
yes, that is pretty precise description of what happens in my implementation.
yes, I do. thank you for doing this thorough analysis. |
actually problem could be reproduced much easier using
|
Workaround spec bug by explicitly carrying information whether navigation is sync (History api, fragment change) or not. See for more details whatwg/html#10232
Workaround spec bug by explicitly carrying information whether navigation is sync (History api, fragment change) or not. See for more details whatwg/html#10232
Workaround spec bug by explicitly carrying information whether navigation is sync (History api, fragment change) or not. See for more details whatwg/html#10232
Steps to reproduce:
The text was updated successfully, but these errors were encountered: