You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If a pushState has just occurred and the Safari poller checks to see
if the hash has changed before the hashchange propagates, then it
sees the new state as being different from the actual state, thus
triggering a pushState. This patch sets a flag (waitForPropagation)
which is cleared by an interval after the hashchange finally
propagates.
The question.. what happens if a second pushState occurs before
the hashchange propagates?
If a pushState has just occurred and the Safari poller checks to see
if the hash has changed before the hashchange propagates, then it
sees the new state as being different from the actual state, thus
triggering a pushState. This patch sets a flag (waitForPropagation)
which is cleared by an interval after the hashchange finally
propagates.
The question.. what happens if a second pushState occurs before
the hashchange propagates?
History.storeState was only updating the urlToId mapping when new states
were stored during the session, and then updating the idToState and
stateToId mappings on unload, so when the safariStatePoll attempted
to check if the current state was the lastSavedState, that function's
dependency on extractState would fail as it was using the idToState
mapping.
I notice that on Safari 5.0.x, sometimes I get constant "statechange" events occurring. This is problematic because in our use case, this manifests as the page constantly reloading. Is that related to this patch?
The problem we had in particular was that the first time we would pushState, the Safari poll would think a statechange had occurred because the document.location.hash had not updated to the new state. This patch introduces a guard which blocks the poll until the hash matches the newly-pushed state. There were some other bugs involved, which included the various stateToId / idToState / urlToState mappings not being properly updated. If you can show me an example I could see if it looks related.
On Mar 25, 2012, at 6:55 PM, Chris M. Welsh wrote:
I notice that on Safari 5.0.x, sometimes I get constant "statechange" events occurring. This is problematic because in our use case, this manifests as the page constantly reloading. Is that related to this patch?
Reply to this email directly or view it on GitHub: #150 (comment)
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a pushState has just occurred and the Safari poller checks to see
if the hash has changed before the hashchange propagates, then it
sees the new state as being different from the actual state, thus
triggering a pushState. This patch sets a flag (waitForPropagation)
which is cleared by an interval after the hashchange finally
propagates.
The question.. what happens if a second pushState occurs before
the hashchange propagates?