* 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
* Remove references to removed classes
* Remove references to FSTSyncEngine
* Fix references to Objective-C names that are no longer valid.
* Remove forward declarations to classes that don't exist
* Remove FSTTypes.h
* Remove usages of headers that no longer apply
* Clean up header imports
* Remove traces of Objective-C from api/firestore.{h,mm}
* Strip NS_ASSUME_NONNULL directives that don't apply
* Remove FSTSyncEngine.h
* Add a test that verifies canonical IDs don't change
* Remove Query::AtPath
This has no parallel in Typescript or Java implementations.
* Add util::Equals
... for comparing pointers by the thing to which they point.
* Use std::shared_ptr<const std::string> for collection group IDs
* Reorder/Cleanup C++ Query to match Android
* Add collection group to C++ Query
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.
* Remove stale references to DatabaseId
* Have Firestore take the DatabaseId directly
* Allow tests to default the database implicitly
* Have FSTSerializerBeta take DatabaseId by value
* Have FSTUserDataConverter take DatabaseId by value
* Make FIRFirestore.databaseID a const reference
* Make FSTFirestoreClient.databaseID a const reference
* Have FSTReferenceValue take DatabaseId by value
* Have DatabaseInfo take DatabaseId by value
* Have Serializer take DatabaseId by value
* Fix C++ ReferenceValue
* Take DatabaseId by value
* Reverse order to match Android
* Rename `reference` to `key`
* Create api::WriteBatch "port" of FIRWriteBatch.
* Make FIRWriteBatch a wrapper around an api::WriteBatch (and a FSTUserDataConverter for parsing input).
* 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.
* Creates a C++ api::Settings class as a container for the settings we pass
into the core client.
* Adds [FIRFirestoreSettings internalSettings] to convert from public API
settings to api::Settings.
Input validation, etc. still happens in FIRFirestoreSettings.
* Tunnel underlying NSErrors through Status
* Make FIRFirestoreErrorDomain available to CMake builds
The prior state was actually semi-broken. The
firebase_credentials_provider_apple definition wasn't extern "C" so it
was defining the value in addition to whatever FIRFirestore was doing.
FIRFirestore's value isn't available to straight C++ though, so this
change pushes the definition down into error_apple.mm so that it can be
shared by the Objective-C API and MakeNSError.
Pushing MakeNSError up into the API layer isn't practical yet so this
change is a compromise that makes things work
* 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.
* replace all references to `FSTDispatchQueue` and `FSTTimerID` with their C++ equivalents;
* remove `FSTDispatchQueue` class and related tests;
* in method argument names, replace `workerDispatchQueue` with just `workerQueue`, more similar to other platforms;
* move `Executor` and derived classes out of `internal` namespace.
* Add a MakeStringView benchmark
Turns out this is worse than just creating a std::string:
BM_MakeString 29 ns 29 ns 189065849
BM_MakeStringView 59 ns 59 ns 93013367
* Convert database_id to take std::string
* Convert DatabaseInfo to take std::string
* Convert User to take std::string
* Convert Token to take std::string
* Convert MakeStringView([NSString stringWithFormat:]) to StringFormat
* Move Firestore to Auth interop library.
* Fixed TODO with no name.
* Extract interop into separate class.
* Further Firestore interop changes.
* Move auth instance to constructor of CredentialsProvider.
* Resolved travis failures.
* Create separate queue for FIRApp instances, remove dead test code.
* Add missing <string> import.
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.
* 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
* add a new property `timestampsInSnapshotsEnabled` to `FirestoreSettings`, `false` by default;
* add a verbose warning message urging users to opt into the new behavior;
* set `timestampsInSnapshotsEnabled` to true in the integration tests to reduce the verbose console
spam during the test run and make sure the flag won't break anything once it's flipped.
* 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
* lazy replacing FST(Firebase)CredentialsProvider by (Firebase)CredentialsProvider
* lazy replacing FSTUser by User
* adding error-code parameter to TokenListener
* actually use const user& instead of pointer; also add an error util
* add HashUser and pass into the unordered_map
* use User in test
* use c++ CredentialsProvider and subclass in test
* fix unit test
* use explicit capture in lambda instead of capture all by reference
* cache currentUser explicitly when reset sync engineer test driver
* objc object should be captured by value in lambda
* replacing Auth/FSTUser by C++ auth implementation
* address changes
* replacing FSTGetTokenResult by C++ Token implementation
* address changes
* fix unintentional change in merging
* patch the change in objc Auth up-stream
* somehow, the lambda-version of set-user-change-listener does not work... fallback to block
* address changes
* fix another const& v.s. dispatch bug
* fix more const& v.s. dispatch bug zxu123 committed
* fix a bad sync line
* address changes
* address change
* address change
* fix upstream change from merge
* fix upstream changes
* Suggested fixes for cpp/port_auth (#846)
* Get rid of MockDatastore factory
This avoids the need to statically allocate (and leak) a credentials
provider
* Use absl::make_unique
std::make_unique technically does not exist until C++14.
* #include <utility> for std::move
* Use std::future for the initial user
* fix style