Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($browser): account for IE deserializing history.state on each read #9587

Closed
wants to merge 1 commit into from

Conversation

mgol
Copy link
Member

@mgol mgol commented Oct 13, 2014

fix($browser): account for IE deserializing history.state on each read

IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
history.state on every hashchange or popstate event.

Also:

  1. Prevent firing onUrlChange callbacks twice if both popstate and hashchange
    event were fired.
  2. Fix the issue of routes sometimes not firing the URL change in all browsers.

Closes #9587
Fixes #9545

mgol added a commit to mgol/angular.js that referenced this pull request Oct 13, 2014
IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.

Also, prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.

Closes angular#9587
Refs angular#9545
@mgol mgol self-assigned this Oct 13, 2014
@mgol mgol added this to the 1.3.0-rc.6 milestone Oct 13, 2014
mgol added a commit to mgol/angular.js that referenced this pull request Oct 13, 2014
IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.

Also, prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.

Closes angular#9587
Refs angular#9545
mgol added a commit to mgol/angular.js that referenced this pull request Oct 13, 2014
IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.

Also, prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.

Closes angular#9587
Refs angular#9545
@mgol
Copy link
Member Author

mgol commented Oct 13, 2014

This PR in its current form fixes the inifinite digest in IE issue but makes the problem reported in #9545 (comment) even worse; investigating.

EDIT: the issue is now resolved.

mgol added a commit to mgol/angular.js that referenced this pull request Oct 13, 2014
IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.

Also:
1. Prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.
2. Fix the issue of routes sometimes not firing the URL change in all browsers.

Closes angular#9587
Fixes angular#9545
@mgol
Copy link
Member Author

mgol commented Oct 13, 2014

I still need to think how to write the test for the specific issue described in #9545.

IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.

Also:
1. Prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.
2. Fix the issue of routes sometimes not firing the URL change in all browsers.

Closes angular#9587
Fixes angular#9545
@mgol mgol closed this in 1efaf3d Oct 13, 2014
@mgol mgol deleted the ie-state-copied branch October 13, 2014 16:04
mgol added a commit to mgol/angular.js that referenced this pull request Oct 13, 2014
Check that pushState is not invoked if $browser.url() and $browser.state()
is passed to $browser.url setter.

Also, a minor refactor in $browser.url code and $browser specs.

Refs angular#9587
mgol added a commit to mgol/angular.js that referenced this pull request Oct 13, 2014
Check that pushState is not invoked if $browser.url() and $browser.state()
is passed to $browser.url setter.

Also, a minor refactor in $browser.url code and $browser specs.

Refs angular#9587
mgol added a commit that referenced this pull request Oct 13, 2014
Check that pushState is not invoked if $browser.url() and $browser.state()
is passed to $browser.url setter.

Also, a minor refactor in $browser.url code and $browser specs.

Refs #9587
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$location.state problems in 1.3.0-rc.5
2 participants