Greetings,
I've been trying to add offline mode support to our app using the latest Firebase SDK on iOS. I've been experiencing weird issues, however.
Simplified database structure:
projects
(key)
key1: value1
key2
subkey1: value1
subkey2: value2
key3
(subkey)
subsubkey1: value1
When the app launches, I set the keepSynced flag to true on all relevant projects for the current user (i.e. on all projects/(key) nodes that belong to said user). This works fine and I can keep accessing the data if the connection drops.
If I create a new project while offline, however, I experience peculiar issues:
Example project:
projects
(key generated with childByAutoId)
key1: value1
key2
subkey1: value1
subkey2: value2
key3
(subkey)
subsubkey1: value1
I assume the write goes through to the local cache (since we get no callback until it gets written to the real database) but trying to call single value observers is unreliable: I can retrieve key2 and its contents without a hitch but key1 and key3 get stuck (as if the data wasn't available - i.e. the callback is not called until I reestablish the network connection). I'm trying to find a pattern to all of this but I'm afraid there is something I just don't understand.
Any ideas?
Regards,
-BB