1 Suppose that i am doing something like following
FirestoreDatabase.getInstance()
.collection("users")
.add(userData); // where userData is reference to UserData object which contains many fileds
Now if i am showing that data in recyclerview , the client library will show that immediately in recyclerview even before it is saved in firestore database to keep my app more responsive.
So when the data shows up in the recyclerview the user thinks he successfully added the data BUT what happens if the write request fails when the data reach the firestore , will the onFailure
listner trigger and as the data already in the UI before actual write wil the data disappear from the UI ?
2 When the user is offline he can still use the app and add the data and shows up in UI for user it means he successfully added the data then whey onSuccessListener
gets triggered only when the user is online.
ex supposein successlistener in am displaying a toast saying data added but user only sees it when he is online , when he is offline he can see the data in UI but not toast and thinks why toast didn't show up this time.