I developed an android app using Firebase real time database and some other Firebase services, in the database I have a reference for users, where I store the needed information about the users like this:
I make sure when storing to the database that the user and all of it's fields are initialized and not null or undefined.
All worked fine before trying to enable offline capabilities following this documentation, now I added this line as explained in the documentations in the main activity:
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
and the app works fine offline most of the time, but sometimes, the app crashes with NullPointerException when getting the users list, I check the database and I find a user with only two fields; instanceId, and Id, the rest of the fields are not there. I don't know why is this happening but surely, supporting offline capabilities is the problem.
I'd really appreciate any help I've been looking for days for a solution. Thank you!