FirebaseExtended / angularfire

AngularJS bindings for Firebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$add promise not functioning

wkaskie opened this issue · comments

Version info

Angular: 1.5.6

Firebase: 3.6.6

AngularFire: 2.3.0

Other (e.g. Node, browser, operating system) (if applicable):

Test case

var ref = database.ref('/valid/url/to/collection'),
newList = $firebaseArray(ref);
newList.$add({"key":"value"}).then(function(res) {
console.log("this is never called");
}

Steps to reproduce

Initialize Firebase, connect to database. Use $add on firebaseArray to add data. This works fine, but .then() is never executed.

Expected behavior

newList.$add({"key":"value"}).then will execute when value is added

Actual behavior

Nothing happens. Even a simple console.log() will not run.

Thanks for opening this issue and sorry you ran into this bug! I'm almost positive this is a duplicate of #922, but the Firebase version number you listed is surprising. Are you sure that version number is correct and you aren't using version 3.7.1 or later? The temporary solution is to use version 3.7.0 or earlier which shouldn't have the infinite loop. The best solution is to just wait two more days before we release a new version of the SDK which fixes the underlying issue.

I know that I am requesting the version I listed (I filled out the form based on my HTML header), but it's possible that I've cached 3.7.x. I'll verify the version and cross my fingers! It's a well executed feature that I would love to implement.

That was it! Closing the browser and reopening did the trick! I'll wait for the update.

Firebase 3.7.4 was just released with a fix, see full comments in the other bug (#922 (comment))