Description
[REQUIRED] Step 1: Describe your environment
Xcode version: 12.0.1
Firebase SDK version: 6.34.0
Firebase Component: Firestore
Component version: 6.34.0
Installation method: CocoaPods
[REQUIRED] Step 2: Describe the problem
We had a lot of crash recently with the following error:
FIRESTORE INTERNAL ASSERTION FAILED: Invalid field path (). Paths must not be empty, begin with '.', end with '.', or contain '..' (expected !segment.empty())
After inspecting the code and the stack trace, it's seems that this crash is coming from an assertion when trying to retrieve a query from the levelDB caches specifically on a orderBy. because it's coming from the FromServerFormatView
, we don't have any crashes coming from FromDotSeparatedStringView
so it's not directly related to our codebase
Because all the FIRESTORE INTERNAL ASSERTION FAILED
are grouped in one single crash in Crashlytics I can't really tell you how much it's impacting our app but it's one of the biggest redundancies.
Here is the full stack trace:
FIRESTORE INTERNAL ASSERTION FAILED: Invalid field path (). Paths must not be empty, begin with '.', end with '.', or contain '..' (expected !segment.empty())
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x19e625114 __exceptionPreprocess
1 libobjc.A.dylib 0x1b1e4bcb4 objc_exception_throw
2 CoreFoundation 0x19e534308 -[CFPrefsSearchListSource addManagedSourceForIdentifier:user:]
3 Foundation 0x19f866ca8 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
4 Wizz 0x100a9c7b0 firebase::firestore::util::ObjcThrowHandler(firebase::firestore::util::ExceptionType, char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 59 (exception_apple.mm:59)
5 Wizz 0x100a9c300 firebase::firestore::util::Throw(firebase::firestore::util::ExceptionType, char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 91 (exception.cc:91)
6 Wizz 0x100aeb968 firebase::firestore::util::internal::FailAssertion(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) + 42 (hard_assert.cc:42)
7 Wizz 0x100aeba08 firebase::firestore::util::internal::FailAssertion(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) + 49 (hard_assert.cc:49)
8 Wizz 0x100aa0dc8 firebase::firestore::model::FieldPath::FromServerFormatView(absl::lts_2020_02_25::string_view)::$_1::operator()() const + 122 (field_path.cc:122)
9 Wizz 0x100aa0af4 firebase::firestore::model::FieldPath::FromServerFormatView(absl::lts_2020_02_25::string_view) + 171 (field_path.cc:171)
10 Wizz 0x100aa09d8 firebase::firestore::model::FieldPath::FromServerFormat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 113 (field_path.cc:113)
11 Wizz 0x100b4bb40 firebase::firestore::remote::Serializer::DecodeOrderBy(firebase::firestore::nanopb::Reader*, firebase::firestore::_google_firestore_v1_StructuredQuery_Order const&) const + 1420 (string:1420)
12 Wizz 0x100b4a930 firebase::firestore::remote::Serializer::DecodeOrderBys(firebase::firestore::nanopb::Reader*, firebase::firestore::_google_firestore_v1_StructuredQuery_Order*, unsigned int) const + 1334 (serializer.cc:1334)
13 Wizz 0x100b4a174 firebase::firestore::remote::Serializer::DecodeQueryTarget(firebase::firestore::nanopb::Reader*, firebase::firestore::_google_firestore_v1_Target_QueryTarget const&) const + 4086 (memory:4086)
14 Wizz 0x100b0bfc4 firebase::firestore::local::LocalSerializer::DecodeTargetData(firebase::firestore::nanopb::Reader*, firebase::firestore::_firestore_client_Target const&) const + 271 (local_serializer.cc:271)
15 Wizz 0x100b04efc firebase::firestore::local::LevelDbTargetCache::DecodeTarget(absl::lts_2020_02_25::string_view) + 2608 (memory:2608)
16 Wizz 0x100b05178 firebase::firestore::local::LevelDbTargetCache::EnumerateTargets(std::__1::function<void (firebase::firestore::local::TargetData const&)> const&) + 1871 (functional:1871)
17 Wizz 0x100b15af0 firebase::firestore::local::LruGarbageCollector::SequenceNumberForQueryCount(int) + 1831 (functional:1831)
18 Wizz 0x100b156a8 firebase::firestore::local::LruGarbageCollector::RunGarbageCollection(std::__1::unordered_map<int, firebase::firestore::local::TargetData, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, firebase::firestore::local::TargetData> > > const&) + 157 (lru_garbage_collector.cc:157)
19 Wizz 0x100b154ec firebase::firestore::local::LruGarbageCollector::Collect(std::__1::unordered_map<int, firebase::firestore::local::TargetData, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, firebase::firestore::local::TargetData> > > const&) + 142 (lru_garbage_collector.cc:142)
20 Wizz 0x100b14e78 std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::CollectGarbage(firebase::firestore::local::LruGarbageCollector*)::$_16>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::CollectGarbage(firebase::firestore::local::LruGarbageCollector*)::$_16)::'lambda'(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::CollectGarbage(firebase::firestore::local::LruGarbageCollector*)::$_16>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::CollectGarbage(firebase::firestore::local::LruGarbageCollector*)::$_16)::'lambda'()>, void ()>::operator()() + 148 (persistence.h:148)
21 Wizz 0x100afd74c firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) + 2592 (memory:2592)
22 Wizz 0x100b0f22c firebase::firestore::local::LocalStore::CollectGarbage(firebase::firestore::local::LruGarbageCollector*) + 1831 (functional:1831)
23 Wizz 0x100ac12a8 std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ScheduleLruGarbageCollection()::$_6, std::__1::allocator<firebase::firestore::core::FirestoreClient::ScheduleLruGarbageCollection()::$_6>, void ()>::operator()() + 305 (firestore_client.cc:305)
24 Wizz 0x100a7db70 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) + 957 (atomic:957)
25 Wizz 0x100b5f1f0 firebase::firestore::util::Task::ExecuteAndRelease() + 1859 (functional:1859)
26 libdispatch.dylib 0x19e25e280 _dispatch_client_callout
27 libdispatch.dylib 0x19e20356c _dispatch_continuation_pop$VARIANT$mp
28 libdispatch.dylib 0x19e21428c _dispatch_source_invoke$VARIANT$mp
29 libdispatch.dylib 0x19e206e70 _dispatch_lane_serial_drain$VARIANT$mp
30 libdispatch.dylib 0x19e207a84 _dispatch_lane_invoke$VARIANT$mp
31 libdispatch.dylib 0x19e211518 _dispatch_workloop_worker_thread
32 libsystem_pthread.dylib 0x1e3f085a4 _pthread_wqthread
33 libsystem_pthread.dylib 0x1e3f0b874 start_wqthread
>