cocos2dx-cpp-sample icon indicating copy to clipboard operation
cocos2dx-cpp-sample copied to clipboard

Database Offline Capabilities

Open formatCvt opened this issue 8 years ago • 11 comments

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.

formatCvt avatar Oct 27 '17 15:10 formatCvt

@formatCvt which platform are you testing on?

stewartmiles avatar Oct 27 '17 16:10 stewartmiles

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

formatCvt avatar Oct 27 '17 17:10 formatCvt

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

stewartmiles avatar Oct 27 '17 17:10 stewartmiles

@stewartmiles any news?

formatCvt avatar Nov 03 '17 12:11 formatCvt

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

jonsimantov avatar Nov 03 '17 23:11 jonsimantov

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

formatCvt avatar Nov 04 '17 09:11 formatCvt

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 avatar Nov 04 '17 10:11 formatCvt

any news?

formatCvt avatar Nov 22 '17 15:11 formatCvt

Update firebase sdk up to 4.3.0 doesn't help

formatCvt avatar Dec 18 '17 08:12 formatCvt

Update firebase sdk up to 4.4.0 doesn't help

formatCvt avatar Jan 10 '18 21:01 formatCvt

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

formatCvt avatar Feb 17 '18 03:02 formatCvt