-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Bug: certain usage of $location causes infinite digest loop #12168
Comments
Seems like the location.replace() is not happening immediately, but after a short time period, that is enough to cause infinite digest, as it is detected as a location change on each check. I wonder if checking URL change against the actual URL (instead of |
Or it can be solved by saving the actual URL (that should be there) and returning that instead of reading |
Found a working solution that is similar to the What do you think about making sure that once the # got in the URL making sure that it won't get stripped later? |
This issue seems to be present since v1.2.27. Running with v1.2.26 is not triggering infinite digest / page reload (though I'm not certain any more what URL change is causing a page reload any more :) ). |
Ok, so that specific change introduced the infinite digest in this setup: v1.2.26...v1.2.27#diff-ab8fe92910b19f1815d419aead809672R171 Removing the condition solves the infinite digest issue, but the page is still reloading... That's how far I could get for now. I hope I can find some time next week to pick up investigating. |
One more detail: In v1.2.26 the code hits that line: v1.2.26...v1.2.27#diff-ab8fe92910b19f1815d419aead809672L158 While in v1.2.27 hits that one: v1.2.26...v1.2.27#diff-ab8fe92910b19f1815d419aead809672R175 So a |
Returning the Or is there some other reason to maintain |
I suspect it has to do something with this comment: Lines 159 to 162 in 17d8a52
I had no time to setup this specific case locally and experiment with it, but it's on my list. :) |
I can't reproduce this any more on v1.5.10/v1.6.1. It was likely fixed at some point. |
Related to #9629
Actual for angular 1.3.16
Using $location to set search param to null and then invoking
$location.replace()
causing infite digest loop.See example here: http://plnkr.co/edit/udQ8rwDM6TJ3bsD3182l?p=preview
The text was updated successfully, but these errors were encountered: