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

fix($browser): prevent infinite $digest from no trailing slash in IE9 #11587

Closed
wants to merge 3 commits into from

Conversation

hamfastgamgee
Copy link

fix($browser): prevent infinite $digest from no trailing slash in IE9

This fix prevents IE9 from throwing an infinite $digest error when the
user accesses the base
URL of the site without a trailing slash. Suppose you owned
http://www.mysite.com/app
and had an Angular app hosted in a subdirectory "app". If an IE9 user
accessed
http://www.mysite.com/app infinite $digest errors would be thrown on the
console, but the app
itself would eventually resolve properly and work fine. Now the infinite
$digest errors will
not be thrown.

Closes #11439

fix($browser): prevent infinite $digest from no trailing slash in IE9

This fix prevents IE9 from throwing an infinite $digest error when the
user accesses the base
URL of the site without a trailing slash. Suppose you owned
http://www.mysite.com/app
and had an Angular app hosted in a subdirectory "app". If an IE9 user
accessed
http://www.mysite.com/app infinite $digest errors would be thrown on the
console, but the app
itself would eventually resolve properly and work fine. Now the infinite
$digest errors will
not be thrown.

Closes angular#11439
@hamfastgamgee
Copy link
Author

Paging @tbosch for input, since I'm removing an optimization he added. function $locationWatch in location.js is causing an infinite $digest problem in IE9 if you have a base URL and you access the site via that base URL without a trailing slash. The reloadLocation variable gets set on the initial change to app/#, but it doesn't get reset on the second change to app/#/ or app/#/Home (assume Home is the "otherwise" route).

I tried nuking reloadLocation in the truthy sameBase circumstances and it didn't help because we were in a case where IE doesn't update location.href. I also tried setting reloadLocation if either replace was true or sameBase was false, and it fixes the cases where the "otherwise" route kicks in (since replace is still true) but not other cases like in the testcase linked from #11439.

@hamfastgamgee
Copy link
Author

And, of course, the tests bomb. Ugh.

fix($browser): prevent infinite $digest from no trailing slash in IE9

This fix prevents IE9 from throwing an infinite $digest error when the
user accesses the base
URL of the site without a trailing slash. Suppose you owned
http://www.mysite.com/app
and had an Angular app hosted in a subdirectory "app". If an IE9 user
accessed
http://www.mysite.com/app infinite $digest errors would be thrown on the
console, but the app
itself would eventually resolve properly and work fine. Now the infinite
$digest errors will
not be thrown.

Closes angular#11439
fix($browser): prevent infinite $digest from no trailing slash in IE9

This fix prevents IE9 from throwing an infinite $digest error when the
user accesses the base
URL of the site without a trailing slash. Suppose you owned
http://www.mysite.com/app
and had an Angular app hosted in a subdirectory "app". If an IE9 user
accessed
http://www.mysite.com/app infinite $digest errors would be thrown on the
console, but the app
itself would eventually resolve properly and work fine. Now the infinite
$digest errors will
not be thrown.

Closes angular#11439
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants