firebase-ios-sdk: FIRESTORE INTERNAL ASSERTION FAILED: Trying to compare documents on fields that don't exist. (expected value1.has_value() && value2.has_value())
[REQUIRED] Step 1: Describe your environment
- Xcode version:13.1
- Firebase SDK version:8.10.0
- Installation method:
CocoaPods - Firebase Component: Auth, Core, Database, Firestore, Messaging, Storage
- Target platform(s):
iOS
[REQUIRED] Step 2: Describe the problem
Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x9904c __exceptionPreprocess 1 libobjc.A.dylib 0x15f54 objc_exception_throw 2 Foundation 0x130834 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] 3 FirebaseFirestore 0x44868 (Missing) 4 FirebaseFirestore 0x44348 (Missing) 5 FirebaseFirestore 0x914b4 (Missing) 6 FirebaseFirestore 0x91554 (Missing) 7 FirebaseFirestore 0xd88a4 (Missing) 8 FirebaseFirestore 0xdf468 (Missing) 9 FirebaseFirestore 0x3b84c (Missing) 10 FirebaseFirestore 0x40650 (Missing) 11 FirebaseFirestore 0x40470 (Missing) 12 FirebaseFirestore 0x38920 (Missing) 13 FirebaseFirestore 0x38528 (Missing) 14 FirebaseFirestore 0x3836c (Missing) 15 FirebaseFirestore 0x121fec (Missing) 16 FirebaseFirestore 0x10bd58 (Missing) 17 FirebaseFirestore 0x10b860 (Missing) 18 FirebaseFirestore 0x68b18 (Missing) 19 FirebaseFirestore 0x5b40 (Missing) 20 FirebaseFirestore 0x1169c0 (Missing) 21 libdispatch.dylib 0x4660 _dispatch_client_callout 22 libdispatch.dylib 0xbde4 _dispatch_lane_serial_drain 23 libdispatch.dylib 0xc958 _dispatch_lane_invoke 24 libdispatch.dylib 0x171a8 _dispatch_workloop_worker_thread 25 libsystem_pthread.dylib 0x10f4 _pthread_wqthread 26 libsystem_pthread.dylib 0xe94 start_wqthread
Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x129754 __exceptionPreprocess 1 libobjc.A.dylib 0x287a8 objc_exception_throw 2 CoreFoundation 0x2b3f8 -[CFPrefsSearchListSource addManagedSourceForIdentifier:user:] 3 Foundation 0xd0a6c -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] 4 FirebaseFirestore 0x44868 (Missing) 5 FirebaseFirestore 0x44348 (Missing) 6 FirebaseFirestore 0x914b4 (Missing) 7 FirebaseFirestore 0x91554 (Missing) 8 FirebaseFirestore 0xd88a4 (Missing) 9 FirebaseFirestore 0xdf468 (Missing) 10 FirebaseFirestore 0x3b84c (Missing) 11 FirebaseFirestore 0x40650 (Missing) 12 FirebaseFirestore 0x40470 (Missing) 13 FirebaseFirestore 0x38920 (Missing) 14 FirebaseFirestore 0x38528 (Missing) 15 FirebaseFirestore 0x3836c (Missing) 16 FirebaseFirestore 0x121fec (Missing) 17 FirebaseFirestore 0x10bd58 (Missing) 18 FirebaseFirestore 0x10b860 (Missing) 19 FirebaseFirestore 0x68b18 (Missing) 20 FirebaseFirestore 0x5b40 (Missing) 21 FirebaseFirestore 0x1169c0 (Missing) 22 libdispatch.dylib 0x481c _dispatch_client_callout 23 libdispatch.dylib 0xc004 _dispatch_lane_serial_drain 24 libdispatch.dylib 0xcc00 _dispatch_lane_invoke 25 libdispatch.dylib 0x174bc _dispatch_workloop_worker_thread 26 libsystem_pthread.dylib 0x37a4 _pthread_wqthread 27 libsystem_pthread.dylib 0xa74c start_wqthread
Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x12a5f0 __exceptionPreprocess 1 libobjc.A.dylib 0x5bcc objc_exception_throw 2 CoreFoundation 0x2d7bc +[_CFXNotificationTokenRegistration keyCallbacks] 3 Foundation 0xd5134 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] 4 FirebaseFirestore 0x44868 (Missing) 5 FirebaseFirestore 0x44348 (Missing) 6 FirebaseFirestore 0x914b4 (Missing) 7 FirebaseFirestore 0x91554 (Missing) 8 FirebaseFirestore 0xd88a4 (Missing) 9 FirebaseFirestore 0xdf468 (Missing) 10 FirebaseFirestore 0x3b84c (Missing) 11 FirebaseFirestore 0x40650 (Missing) 12 FirebaseFirestore 0x40470 (Missing) 13 FirebaseFirestore 0x38920 (Missing) 14 FirebaseFirestore 0x38528 (Missing) 15 FirebaseFirestore 0x3836c (Missing) 16 FirebaseFirestore 0x121fec (Missing) 17 FirebaseFirestore 0x10bd58 (Missing) 18 FirebaseFirestore 0x10b860 (Missing) 19 FirebaseFirestore 0x68b18 (Missing) 20 FirebaseFirestore 0x5b40 (Missing) 21 FirebaseFirestore 0x1169c0 (Missing) 22 libdispatch.dylib 0x5b524 _dispatch_client_callout 23 libdispatch.dylib 0x38b3c _dispatch_lane_serial_drain$VARIANT$armv81 24 libdispatch.dylib 0x3954c _dispatch_lane_invoke$VARIANT$armv81 25 libdispatch.dylib 0x4284c _dispatch_workloop_worker_thread 26 libsystem_pthread.dylib 0xbb74 _pthread_wqthread 27 libsystem_pthread.dylib 0xe740 start_wqthread
Steps to reproduce:
Three different crash log added above but all occurred on same condition. Basically crash happened when user update firestore document field value to “nil” while force close the app.
Relevant Code:
let fieldValue:Int? = nil let updatedMap = [“number_field”: fieldValue] Firestore.firestore().collection(“users”) .document(String(120)) .setData(updatedMap as [String : Any], merge: true)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 50 (24 by maintainers)
@igorvoytovich Thanks for the info. That gives a pretty strong indicator that the crash is fixed. I’ll wait for @sspogra to reply to see if the crash resolution is confirmed.
@igorvoytovich Thanks for the updated stack trace. My guess is that my fix #9550 fixed the original crash, and now it’s gotten past the point where it was previously crashing and is now crashing in a different place. Since it’s not clear, I’d like to treat it as a new issue. Would you mind opening a new issue with this new stack trace? Even if it’s related, it’s going to require its own investigation.
Also, you mentioned in your older comment (https://github.com/firebase/firebase-ios-sdk/issues/9258#issuecomment-1024736997) that you were getting “hundreds” of reports of the old crash. Do you still get any reports of the old stack trace after upgrading to 8.15.0? Or are all of your crashes this “new” stack trace since upgrading to 8.15.0?
@dconeybe App still not updated on app store with new firebase version. For now you can close this issue, I will comment here when my app was live on store.
@dconeybe I will check this only when app release to app store. Our app will be release within 10 days. After that i can provide you feedback.
Hello @dconeybe Updated stack trace
This is the raw stack trace we are seeing on version 8.13.0
@sspogra The improvement of the error message has been incorporated into version 8.12.1 of the iOS SDK, released on February 10, 2022. When you get a chance, upgrade your dependency to this new version and provide updated stack traces and error messages.