-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddDoc error not being caught #3593
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hi @manuelsrleon, the behavior you’re observing is not a bug but rather a consequence of Firestore/AngularFire’s offline-first design. Details Approaches to Handle Connectivity or Synchronization Issues
Summary The addDoc operation resolves its Promise once the document is written locally. It does not wait for server synchronization, so connectivity errors won’t trigger the catch block. To handle such errors, consider monitoring the synchronization status or disabling offline persistence based on your application’s needs. |
Good morning.
In our project, I've been trying to handle the output of an addDoc call using angular/fire. The exception will get caught but not the error thrown by addDoc. When uncommenting the line //throw "patata" the catch block will get executed.
I don't know if it is a bug or what it is, but this is specially important since it seems like the appropriate way to handle connection errors and any other kinds of errors in my app. Right now I can only implement the "happy path".
I'm using Chromium v130, angularfire 18.0.1, with Angular 18.1.3, connecting to a docker container running a firebase emulator. When I want to test no connectivity, I take down the firebase container.
Thanks in advance, appreciate your help.
The text was updated successfully, but these errors were encountered: