-
Notifications
You must be signed in to change notification settings - Fork 627
Angularfire 2.3.0 incompatible with firebase 3.7.1 #922
Description
Version info
Angular:
1.6.1
Firebase:
3.7.1
AngularFire:
2.3.0
Other (e.g. Node, browser, operating system) (if applicable):
Chrome Version 56.0.2924.87 (64-bit)
Test case
https://plnkr.co/edit/kKHCbTgqVicuHUAHwigr?p=preview
Steps to reproduce
- Input your firebase credentials
- (optionally) set your DB rules to allow read/write anonymously for test purposes
- when the plunkr runs, the window should freeze.
Pausing the execution in dev tools will show you an infinite async loop that I'm describing at the end of this report.
Expected behavior
not freezing
Actual behavior
freezing
Some debugging info
When using 3.6.6 and stepping into the $add function. We can see that the firebase reference looks like this:
ref: U
Nc: false
catch: undefined
database: (...)
key: (...)
m: ee
parent: (...)
path: L
ref: (...)
root: (...)
then: undefined
u: Te
__proto__: X
When using 3.7.1 and stepping into the $add function. We can see that the firebase reference looks like this:
ref: T
Nc: false
catch: ()
database: (...)
key: (...)
m: lg
parent: (...)
path: L
ref: (...)
root: (...)
then: ()
u: Sd
__proto__: Y
Wee se that catch
and then
are functions. Which seems to lead to an endless async loop in angular ($q). Where the recursive function $$resolve
keeps calling itself, from here:
https://github.com/angular/angular.js/blob/03043839d5a540b02208001fe12e812dfde00a8e/src/ng/q.js#L426
and here:
https://github.com/angular/angular.js/blob/03043839d5a540b02208001fe12e812dfde00a8e/src/ng/q.js#L439
because this:
https://github.com/angular/angular.js/blob/03043839d5a540b02208001fe12e812dfde00a8e/src/ng/q.js#L424
keeps being true
That's as far as I got :) I don't understand how or why this is happening, but I believe I have pinned down where it happens and I'm able to reproduce it.
I haven't found any other reports of this so I hope I'm not reposting :)