Skip to content
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

If there is not a state with '/' defined, infinite loop #2238

Closed
eddiemonge opened this issue Sep 11, 2015 · 4 comments
Closed

If there is not a state with '/' defined, infinite loop #2238

eddiemonge opened this issue Sep 11, 2015 · 4 comments
Labels
Milestone

Comments

@eddiemonge
Copy link
Contributor

http://plnkr.co/edit/cH0LiMq29CIyzfZzHYva?p=preview

Seems like if there is not a state with a url of '/' then the states will go in an infinite loop.

@filipesilva
Copy link
Contributor

I did some testing, and it seems that the / state cannot be an abstract parent state.

http://plnkr.co/edit/0wnnfKpS9l11i4azravK

@christopherthielen
Copy link
Contributor

App Bootstraps; url is ""
-> check rules against ""; only otherwise('/home') matches
-> $location.path('/home')
-> check rules against "/home"; match 'home' and transitionTo('home') (Transition 1)
-> Transition 1) $stateChangeStart.preventDefault()
-> transitionTo('login') (Transition 2)
-> Transition 2) $stateChangeStart, not prevented; goes to async portion
-> Stack popped until we get back to...
-> Transition 1) $stateChangeStart.defaultPrevented === true, so call $urlRouter.update()
-> $location.path() is reset to the last know url, ""
cycle starts

@christopherthielen
Copy link
Contributor

I can't seem to create a failing unit test. Perhaps this is due to the mocks behaving differently.

edit: Thanks to the #600 (comment) by @filipesilva I was able to create a failing test case.

Also interesting: the plunker works if you downgrade angular to 1.3.3 or earlier. 1.3.4 and above exhibit the infinite digest.

@filipesilva
Copy link
Contributor

I'm glad to hear I was of help @christopherthielen. Great job on the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants