* Rationalize input validation exceptions and assertions
... under a single ThrowHandler concept. This makes it possible to set
an alternative ThrowHandler in our C# bindings that properly translates
input validation exceptions to the correct .NET exception types.
* Rename api/input_validation.h to util/exception.h
* Reimplement util/hard_assert.h in terms of util/exception.h
* Rewrite Document-related classes as a polymorphic value type
* Pass ObjectValue without rvalue references
* Rename HasLocalMutations
* Port C++ users to new Documents
* Port FSTDocumentTests to C++
* Port FSTDocumentSetTests to C++
* Migrate DocumentMap and DocumentSet to C++ Document
* Migrate test helpers
* Delete FSTDocumentSetTests
* Delete FSTDocumentTests
* Mechanical changes to use C++ Document
* Updates to the project file
* Nontrivial test updates
* Remove FSTTestDeletedDoc
* Remove FSTTestUnknownDoc
* Remove FSTDocument
* Convert usage of FSTDocument to C++ Document
* Fix Serializer usage of Documents
* Port FSTSortOrder to C++ OrderBy
* Finish port of C++ Direction from Android
* Reimplement FSTSortOrder with C++ OrderBy
* Migrate FSTSortOrder to C++ OrderBy
* Remove FSTSortOrder
* Compare OrderBy equality in C++ Query
* Add FieldValue::Reference
* Migrate FSTReferenceValue to FSTDelegateValue
* Build Objective-C components with CMake
Build only the things required for FSTFieldValue
This is safer and better matches our design (and the other platforms), since
classes like api::DocumentReference will have references to api::Firsetore but
the lifetime is controlled by the developer, not us.
use namespace aliases instead.
This makes the Objective-C code much more like what it's going to end up
being like when translated to C++: headers will include classes declared
in a namespace relative to firebase::firestore so everything else will
be named relative to firebase::firestore.
Meanwhile the using statements in the headers were causing us to miss
adding using statements in source files which was moving us away from
where we wanted to be.
Note:
* This includes a partial port of array-contains for Filters because
this silenced a warning about an unhandled case
* There's some sensitivity to the order of the cases that I didn't
bother to figure out; instead I just made it match what came before.
* Fix a couple small issues I tripped over today.
1. Fix primeBackend so it uses an isolated FIRFirestore* instance. I ran into
an issue where tests that try to change .settings would fail if they were the
very first test run, since primeBackend had already configured the client and
so settings could no longer be changed.
2. Remove FIRFirestore.client and make api::Firestore.client() assert client is configured.
Previously, we checked for FSTFieldValue subtypes via:
`[value isKindOfClass:[FSTStringValue class]]`
Now, we check via a new type parameter on FSTFieldValue, i.e.:
`value.type == firebase::firestore::model::FieldValue::Type::String`
Or with the appropriate using declaration:
`value.type == FieldValue::Type::String`
This should enable easier transition to C++.
* Test that shows a leak.
* Add EventListener to match Android.
* Use AsyncEventListener in FSTQueryListenerTests
* Remove FSTAsyncQueryListener
* Use EventListener throughout
Without this, it still fails, but:
a) not until serializing the query, and
b) the error is an internal error, and
c) the error message is quite cryptic and has nothing to do with the problem.
Port of https://github.com/firebase/firebase-android-sdk/pull/138
Rather than previously inlining it in the calling code. This is to unify
filter creation across platforms.
(This change involves altering FSTFilter from a protocol to an abstract
class.)
FSTDispatchQueue enforces serial execution, which is inappropriate for
user queue, because a user may configure usage of a concurrent queue in
settings, breaking FSTDispatchQueue invariants. Instead, use C++
ExecutorLibdispatch directly.
Add option to allow the user to control where DocumentReference.getDocument() and CollectionReference.getDocuments() fetches from. By default, it fetches from the server (if possible) and falls back to the local cache. It's now possible to alternatively fetch from the local cache only, or to fetch from the server only (though in the server only case, latency compensation is still enabled).
* Replace `QueryListenOptions` with simple booleans
Instead of calling
addSnapshotListener(
options:QueryListenOptions.includeQueryMetadataChanges()
.includeDocumentMetadataChanges())
call
addSnapshotListener(includeMetadataChanges:true)
Also change `QuerySnapshot.documentChanges()` into a method which
optionally takes `includeMetadataChanges:true`. By default even when
listening to a query with `inlcudeMetadataChanges:true` metadata-only
document changes are suppressed because they're confusing.
* Revert QuerySnapshot.documentChanges back to a property
Add usage.
* naively remove FSTPath import and source/test files.
* port FieldPath, part I
* port FieldPath, part II
* port ResourcePath, part I
* port ResourcePath, part II
* the grand commit to fix build errors
* use testutil:: helper instead of those from FSTHelpers
* fix test and lint
* use c_str in errmsg directly
* fix
* fix
* make code clean
* fix integration test I missed
* fix to avoid naming collision in preprocessor
* address changes
* address changes
* address changes
* fix: fieldMask are actually shared with different context.
* address changes
* address changes
* add converters and fix FSTQuery.{h,m} only
* address changes
* a change forget to address
* add a dummy function to make inline-only-library buildable
* Move all Firestore files to Objective-C++
* Update project file references
* Don't use module imports from Objective-C++
* Use extern "C" for C-accessible globals
* Work around more stringent type checking in Objective-C++
* NSMutableDictionary ivars aren't implicitly casted to NSDictionary
* FSTMaybeDocument callback can't be passed a function that accepts
FSTDocument
* NSComparisonResult can't be multiplied by -1 without casting
* Add a #include <inttypes.h> where needed
* Avoid using C++ keywords as variables
* Remove #if __cplusplus guards