Closed liamcharger closed 5 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
This is expected behavior and is covered in the API reference docs. The completion handler is not called until the write is acknowledged by the server, so the completion handler cannot be called while offline.
I'm going to close this, but if you have follow up concerns, please let us know.
How should I handle this properly then? Should I just dismiss the sheet, and not worry if there's an error, or is there a better way? Are errors even called when the client is offline?
I generally can't advise you on how to architect your app. But if you decide it works for you then it would be possible to take an action, like dismissing the sheet, after the call updateData
. You can still handle errors when the callback is eventually called after the device reconnects.
If your use case requires immediate feedback from the Firestore backend, like confirming that the write was successful, then there's no other way to handle this use case than to be online.
Description
When using update, delete, or write functions when the client is offline, callbacks do not appear to be called.
It works fine when the client is online.
Reproducing the issue
Run this code:
Firebase SDK Version
10.26.0
Xcode Version
15.3
Installation Method
Swift Package Manager
Firebase Product(s)
Analytics, Authentication, Firestore, In-App Messaging, Remote Config
Targeted Platforms
iOS
If using Swift Package Manager, the project's Package.resolved
Note: there are some other packages included that I use in my project.