Closed stevdza-san closed 2 months ago
The function will return when the write finishes - as you have offline persistence enabled it will write to the local database but won't finish until you go back online, this is the standard firestore behaviour of the native sdks
Hmm, so what's the best solution here? I don't think adding withTimeout {} seems like a good approach, but I don't see any other?
Either disable offline persistence and it will fail and throw on no network or keep it enabled and consider the value set and trust it will sync to the server once the client is back online
Here's an example of one of my functions, for updating a vehicle object in Firebase. When there is an internet connection, the function properly returns a RequestState object.
However, when I trigger this same function when there is no an internet connection, then this function never returns the above-mentioned RequestState (Even though the operation was successful). It just prints in the log, and my function doesn't catch any exception actually. Am I doing something wrong?