-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
Description
In Swift, if you call Firestore.terminate() and then something manages to access Firestore after that, it crashes the app with the following message:
*** Terminating app due to uncaught exception 'FIRIllegalStateException', reason: 'The client has already been terminated.'
terminating due to uncaught exception of type NSException
The docs say:
After calling
terminateonly theclearPersistencemethod may be used. Any other method will throw an error.
But it isn't throwing an error - it's throwing an Obj-C exception, which cannot be handled in Swift.
This should really just throw an error instead of crashing the app.
Reproducing the issue
In Swift, call Firestore.terminate() and then call any other method on the Firestore instance.
Firebase SDK Version
12.5.0
Xcode Version
26.0.1
Installation Method
Swift Package Manager
Firebase Product(s)
Firestore
Targeted Platforms
All
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!