* Manual Xcode project fixups
* Remove `firebase/firestore` from paths in Firestore/core
This renames all Firestore files under `Firestore/core` to remove the
interior `firebase/firestore` directory structure. This is motivated by
build failures under Windows where the filenames of intermediates were
too long.
Concretely:
* `Firebase/core/src/firebase/firestore` becomes `Firebase/core/src`
* `Firebase/core/test/firebase/firestore` becomes
`Firebase/core/test/unit`
Moving the tests into a `unit` subdirectory aligns Firestore with the
directory structure in
[AddNewPod](https://github.com/firebase/firebase-ios-sdk/blob/master/AddNewPod.md),
modified for C++ (see discussion in #3224).
* Remove rarely used template argumnets from SortedMap/SortedSet
* Remove unused STATUS_CHECK_OK
* Rename QuerySnapshot::Listener to QuerySnapshotListener
This makes the type something that can be forward declared.
* Rename DocumentSnapshot::Listener to DocumentSnapshotListener
This makes the type something that can be forward declared.
* Rename ViewSnapshot::Listener to ViewSnapshotListener
This makes the type something that can be forward declared.
* Put most QueryListener implementation in .cc
* Actually use sync_engine_callback.h
* Add forward declaration headers for api, core, and model
These centralize forward declarations, including declarations for some
hard-to-forward-declare types.
* Move includes of hard_assert.h out of other headers
* Make testutil definitions out of line
* Move definitions out-of-line
* Move DocumentKey definitions out-of-line
* Move definitions out-of-line
* Shorten unnecessarily long namespace usages
* Use default destructors where possible
* Delete unused MutationBatch::kUnknown constant
* Use forward declarations instead of IWYU
* Misc fixups from Linux/GCC 9.2.1
* Fix testutil under VS 2017
Forward declarations of functions local to a function body end up
generating unresolved externals. Reduce most of these back to just
calling FieldValue::FromX methods.
* Remove rarely used template argumnets from SortedMap/SortedSet
* Remove unused STATUS_CHECK_OK
* Rename QuerySnapshot::Listener to QuerySnapshotListener
This makes the type something that can be forward declared.
* Rename DocumentSnapshot::Listener to DocumentSnapshotListener
This makes the type something that can be forward declared.
* Rename ViewSnapshot::Listener to ViewSnapshotListener
This makes the type something that can be forward declared.
* Put most QueryListener implementation in .cc
* Actually use sync_engine_callback.h
* 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
* Port FSTMemoryPersistence to C++ (#3754)
* Add local::Persistence
* Add MemoryPersistence
* Add MemoryEagerReferenceDelegate
* Make LruDelegate extend ReferenceDelegate
This enables downcasting to LruDelegate in tests that need to do so.
* Add MemoryLruReferenceDelegate
* Don't double-count document key size.
* Port FSTLevelDB to C++ (#3755)
* Add LevelDbPersistence
Note that Apple-specific initialization has been partitioned off in
anticipation of being able to run this code on non-Apple platforms.
* Add LevelDbLruReferenceDelegate
* Migrate to C++ Persistence (1/2) (#3756)
* Use C++ Persistence classes in FSTLocalStore
* Remove ReferenceDelegateBridge
* Cut src over to C++ persistence types
* Remove Objective-C requirement from some classes
... that no longer require it.
* Migrate to C++ Persistence (2/2) (#3757)
* Remove LruDelegateBridge
* Update test initialization of persistence components
In particular, ensure that there's always an owner for the Persistence
instance, which wasn't always handled explicitly in the Objective-C
version of the tests.
* Largely mechanical changes to tests
* Remove Objective-C persistence classes
* Forward declare util::Status when possible (#3761)
* Add a header dedicated to forward declarations for util::Status
* Use status_fwd.h wherever possible
This makes it match the convention we've established for other
converters of this type. WrapNSString was perhaps the earliest of these
that we wrote and the convention hadn't yet been established.
* Create api::WriteBatch "port" of FIRWriteBatch.
* Make FIRWriteBatch a wrapper around an api::WriteBatch (and a FSTUserDataConverter for parsing input).
I think the intention was that the user_data.h types should be used as the representation of parsed user data that can be passed down from the public API to the api:: layer, so this PR "fixes" api::DocumentReference to accept ParsedSetData and ParsedUserData in SetData() / UpdateData() instead of taking the list of mutations. This is consistent with the approach I took in the api::WriteBatch port.
Side note: Prior to this change, SetData() / UpdateData() were actually identical methods just with different names.
* Make error_apple definitions out-of-line
* Add util::MakeCallback
Translates between API completion handlers that take just an NSError and
the equivalent std::function that accepts util::Status.
* Port DocumentReference::Completion to a std::function callback
* Port Firestore::ErrorCompletions to StatusCallback
* Port transaction-related completions to C++
* Remove now-unused FSTVoidIDErrorBlock
* Fix tunneling of Firestore-generated NSErrors.
Remove MakeStatus(NSError*) because it has different results from
Status::FromNSError. Ensure that user-supplied errors created in
transactions tunnel through correctly.
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.
* Test that shows a leak.
* Add EventListener to match Android.
* Use AsyncEventListener in FSTQueryListenerTests
* Remove FSTAsyncQueryListener
* Use EventListener throughout
* Replace FSTDocumentSet's guts with immutable::SortedSet.
* Port FSTDocumentSet to C++ DocumentSet.
* Replace implementation of FSTDocumentSet with C++ DocumentSet
* Update all usages of FSTDocumentSet
* Remove FSTDocumentSet
* Add Objective-C++ guard
* Use absl::c_equal instead of hand-rolling it.
* Split SortedContainer out of SortedMapBase
... and use it
* Fix NSNotFound -> npos
* Remove = default constructors that aren't true.
These are implicitly deleted because DocumentSet is a member and isn't
default constructible.
* Fix usage of FSTQuery.limit
* Revert "Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030)"
This reverts commit ea567dca47.
* gRPC: fix bugs found during testing (#2039)
All in `GrpcStream`:
* make sure there are no pending completions when "finish" operation is enqueued;
* always finish gRPC calls;
* when connectivity changes, reset not just the calls, but the underlying channel as well.
* Revert "Partially revert "Update CHANGELOG for Firestore v0.14.0 (#2025)" (#2031)"
This reverts commit b2437b80f6.
* Update changelog for v0.15.0.
* gRPC: add gRPC wrapper classes to CMake build (#2015)
* add a C++ equivalent of `FIRFirestoreVersionString`. This eliminates the only Objective-C dependency of `grpc_connection.mm` and allows making it a pure C++ file;
* open-source `binary_to_array.py` script and use it in the build to embed `roots.pem` certificate file from gRPC into the Firestore binary. The embedded char array is then used to load certificate at runtime.
* Revert local change -- do not enable sanitizers by default
* Drop acknowledged mutations in schema migration (#1818)
Drop acknowledged mutations in schema migration as part of removing held write acks.
Port of firebase/firebase-js-sdk#1149
* Change removeMutationBatch to remove a single batch (#1955)
* Update Firestore Generated Protos
* Adding UnknownDocument and hasCommittedMutations (#1971)
* Removing held write batch handling from LocalStore (#1997)
* View changes for held write acks (#2004)
* Held Write Acks Unit Test Fixes (#2008)
* Held Write Ack Removal Spec Tests (#2018)
* Fix integration test
* add support for SSL disabled to `GrpcConnection` (unfortunately, there
currently is no way to verify this change actually works);
* make gRPC calls using the C++ implementation:
* make `FSTRemoteStore` create C++ streams instead of their Objective-C
counterparts;
* port https://github.com/firebase/firebase-js-sdk/pull/1041: streams
are now never recreated, only restarted;
* make `FSTDatastore` delegate server calls to the C++ implementation;
* port `MockWatchStream` and `MockWriteStream` to C++ (`FSTMockDatastore` is
still in place, because `Datastore` is not fully ported yet);
* no longer generate Objective-C gRPC service definitions from protos;
* remove all references to Objective-C gRPC client;
* check in gRPC root certificates file and load it at runtime (the check-in part
is temporary until gRPC-C++.podspec provides the certificate). This makes SSL
work.
Extract useful bits of FSTUserDataConverter for use in C++:
* Migrate FSTParsedSetData to core::ParsedSetData
* Migrate FSTParsedUpdateData to core::ParsedUpdateData
* Migrate FSTParseContext to core::ParseContext
* Split ParseAccumulator out of ParseContext to make ownership easier
Also:
* Remove dead code (handled in parseSentinelFieldValue)
* Flatten App/iOS/Supporting Files into the parent
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).
* port FieldMask to C++
* address changes
* address changes
* fix test
* address change
* Port transform operations (FSTTransformOperation, FSTServerTimestampTransform) to C++
* address changes
* address changes
* address changes
* implement `FieldTransform` in C++
* port `FieldTransform`
* make `fieldTransforms` shared inside `context`
* Implement Precondition in C++ w/o test yet
* add unit test for `Precondition`
* port `Precondition`
* address changes
* address changes
* fix bugs for integration test
* address changes
* fix lint
* address changes
* address changes
* lint.sh now lints Objective-C++ too
* cpplint checks system-style includes that should be user-style
This prevents it from recognizing project sources as if they were C
system headers and then complaining that they're in the wrong place.
* cpplint checks #imports and #includes
* cpplint checks that C++ system headers aren't #imported
* cpplint checks for C system headers that could be C++ system headers
* cpplint checks that Objective-C sources include their headers
* 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