FirebaseExtended / cocos2dx-cpp-sample

Firebase Cocos2d-x samples
http://firebase.google.com/games
MIT License
53 stars 25 forks source link

Database Offline Capabilities #13

Open formatCvt opened 6 years ago

formatCvt commented 6 years ago

Can you please give example with offline support? Just set_persistence_enabled before creating any instances of DatabaseReference doesn't help. Feature query/set freezes with kFutureStatusPending status.

stewartmiles commented 6 years ago

@formatCvt which platform are you testing on?

formatCvt commented 6 years ago

@stewartmiles android (firebase sdk 4.2.0, cocos2d-x 3.14.1, ndk14b, database sample project from this repo)

stewartmiles commented 6 years ago

@formatCvt thanks we'll get someone to take a look.

formatCvt commented 6 years ago

@stewartmiles any news?

jonsimantov commented 6 years ago

Hi,

Looking into this, there seems to be an issue with disk persistence and the way GetValue is implemented (using single value listener). Does it work if you are online and GetValue first, then go offline and GetValue on the same path again?

Thanks,

Jon

formatCvt commented 6 years ago

Nope. It's not working until connection is back.

formatCvt commented 6 years ago

Here is my changes https://github.com/formatCvt/cocos2dx-cpp-sample/commit/a73f01dca2e7e9e68507918a60983d087b4a86d5 without this authentication fails when device is offline.

Steps to reproduce:

  1. Start example with internet connection
  2. Set key "a" and value "a"
  3. Press "Set" (wait until request successful)
  4. Press "Query" screenshot2017-11-04_13-00-46
  5. Close app and stop internet connection
  6. Start example without internet connection
  7. Set key "a" and value "a"
  8. Press "Query" Feature query_future_ freezes with kFutureStatusPending status until connection is back. screenshot2017-11-04_13-01-14
formatCvt commented 6 years ago

any news?

formatCvt commented 6 years ago

Update firebase sdk up to 4.3.0 doesn't help

formatCvt commented 6 years ago

Update firebase sdk up to 4.4.0 doesn't help

formatCvt commented 6 years ago

With 4.4.1 query is working, but set still freezes until connection is back.