FirebaseExtended / angularfire

AngularJS bindings for Firebase
MIT License
2.73k stars 630 forks source link

Watch on firebaseObject does not fire when offline #682

Closed jstevej closed 3 years ago

jstevej commented 8 years ago

See this plnkr for a demo of this issue.

http://plnkr.co/edit/JgrFbS

  1. Open the JavaScript console.
  2. Play with the buttons for the firebaseArray and firebaseObject.
  3. Notice that console messages are generated when the $watch functions fire.
  4. Click the button to "Go Offline."
  5. Notice that the data still updates as expected, and
  6. The console messages appear for the firebaseArray, but
  7. The console messages do not appear for the firebaseObject any more.
  8. Click the button to "Go Online."
  9. Notice that you now get all the console messages for the firebaseObject.

Expected results: the console messages for the firebaseObject should still show up when offline.

jstevej commented 8 years ago

I posted this to StackOverflow too. I hope that's not a faux pas.

http://stackoverflow.com/questions/34281341/should-firebaseobject-watch-work-when-offline

jstevej commented 8 years ago

Here's a little more info. I did some experiments with using Firebase's set/update vs angularfire's save for putting data into the object, and Firebase's on('value', ...) vs angularfire's $watch for listening for changes.

set/update + on -> works offline set/update + $watch -> works offline $save + on -> works offline $save + $watch -> doesn't work offline

jamesdaniels commented 3 years ago

Closing as stale.