* Change string parameters from absl::string_view to std::string
No abseil types can be used as parameters in this package.
This fixes an issue where Unity builds fail due to missing symbols.
The underlying issue is that Abseil in CocoaPods is an LTS release and
LTS releases contain an inline namespace, making types like
absl::string_view link as absl::lts_2019_08_08::string_view. When
compiling Firestore in google3 it uses the abseil in //third_party/absl,
which is not an LTS release and does not include the inline namespace.
This disagreement causes issues for the public C++ API which is compiled
in google3 and consumes code in the API package.
* Avoid absl::any in interfaces shared with public C++
* Make resource-related methods class members
This gives them access to private methods of friends of Serializer.
* Access control FieldPath/ResourcePath construction
* Access control Document construction
* Access control FieldValue construction
* Access control TransformOperation methods
* Remove DocumentSnapshot constructor that takes metadata pieces individually
* Restrict access to DocumentSnapshot from optional<Document>
* Add comments indicating how Abseil types are restricted
* Make DocumentKey::FromPathString take std::string
* Add Objective-C API tests to the CMake build
* Fix signedness warnings under the CMake build
* Get the remainder of Objective-C tests running under CMake
Also:
* Add a Path::HasExtension check
* Change spec tests to pick up json without NSBundle
* Add Executor::CreateSerial
... a standard way to create an Executor for most cases where we don't
care about the implementation.
* Add ExecutorForTesting/AsyncQueueForTesting
Uses Executor::CreateSerial to do the heavy lifting.
* Use AsyncQueueForTesting
* Avoid direct references to ExecutorLibdispatch in prod code
* Rewrite time_testing in terms of absl::Time
* Migrate async_test_util's now to time_testing
* Fix AddressSanitizer stack-buffer-underflow error
This was reading random data off the stack until it hit a negative
integer's worth of data. The test passed because this was generating the
input and expected values, which were much longer than expected given
the input.
* Tidy up mutation_test.cc ahead of filling it out
* Move FSTUserDataConverter tests out of FSTMutationTests
* Add operator<< for Document
The compiler won't apply the one for MaybeDocument.
* Port FSTMutationTests to C++
* Delete FSTMutationTests
* 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
* Rename FIRQueryTests to FIRQueryUnitTests
* Make IntegrationTests targets run everything
The incremental cost of running all tests is an extra two seconds of run
time, but not starting the simulator three times during a build cuts
build times by ~25%.
* sync_project.rb generated changes
* sync_project.rb generated changes
* Remove AllTests_iOS aggregate target
* Add unit test deps to Firestore_IntegrationTests_*
* Fix BasicCompileTests on macOS and tvOS
* Run Firestore IntegrationTests only on Travis
This cuts build time for the job by about 25%, primarily due to not
having to start/deploy to the simulator repeatedly.
* working serverTimestamp
* working FieldValue. Still need: document ref and ability to Eq of FieldValue
* DocumentReference implemented and testing works
* clean up header search path
* improving FieldValue enum comments
* run through formatting
* addressing comments
* formatted with swiftformat 0.35.7
* add missing bool->BOOL change
* undo unintended swift version change
* remove unwanted proj file change
* remove C++11 library feature from `Timestamp` (which is supposed to be "portable");
* fix return type mismatch (`bool` vs `BOOL`);
* removed unused `using` declaration;
* fix typo in function name.
* Add FieldValue::Reference
* Migrate FSTReferenceValue to FSTDelegateValue
* Build Objective-C components with CMake
Build only the things required for FSTFieldValue
* Rename nanopb::String to nanopb::ByteString
... and flesh it out.
* Remove const pb_bytes_array* constructor
* Use std:: prefixes
* Pull forward CopyVector
* Simplify nanopb::Reader/Writer construction
* Reuse ByteString construction in serializer
* Add nanopb_testing.h
* Make QueryData.resume_token a ByteString
* Use ByteString as FieldValue::blob_value
* Migrate FSTBlobValue to FSTDelegateValue
* Rework the ByteString API
* Make data(), begin(), and end() never return nullptr
* Make copies of pb_bytes_array_t* more obvious (also avoids ambiguity
with the private constructor).
* Remove constructors that duplicate absl::string_view
* Make ByteString::Copy just a constructor
* Remove EncodeBytes/DecodeBytes
These duplicate ByteString constructors
* Overhaul ByteString and users
* Remove most conversions from ByteString
* Put remaining conversions in nanopb_util as free functions
* Make ByteStringWriter accumulate in a pb_bytes_array_t*
* Have ProtobufSerialize use ByteStringWriter
* Avoid reserving/writing if we're not asked to append data
* Ensure ByteStringWriter initializes/frees
* Make copies explicit
* Make Reserve match std::vector::reserve
* Add comments, assertions, and tests
* Migrate FSTNullValue to FSTDelegateValue
* Migrate FSTIntegerValue to FSTDelegateValue
* Migrate FSTDoubleValue to FSTDelegateValue
* Migrate FSTGeoPointValue to FSTDelegateValue
* 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`
* Split data conversion tests into FSTUserDataConverterTests
* Add TestUtil Value/Object to match Java
* Port Java FieldValue tests
* FieldValue::Map -> ObjectValue (#3047)
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.
* Create C++ api::DocumentChange class.
* Make FIRDocumentChange a wrapper over api::DocumentChange.
* Moved documentChangesForSnapshot helper from FIRDocumentChange to
where it's used in QuerySnapshot. I think this is cleaner.
* 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
* Update Firestore project to Xcode 10.1 defaults
* Fix NSUInteger in format strings warning
* Fix implicit conversion warning in FSTLevelDB
* Fix BOOL/bool mismatch
* Fix erroneous comparison
This failure shows up on 32-bit targets. I have no idea why this
succeeds on 64-bit targets.
* Fix incorrect type inference with explicit cast
clang is inferring the type of the key in these maps is `NSString *` and
then complaining that `FIRFieldValue *` doesn't match that type, despite
the underlying method taking `NSDictionary<id, id>`. Explicitly casting
to `id` prevents the warning.
* Remove reliance on representation in FSTFieldValue tests
On *some* platforms [NSNumber numberWithChar:1] ends up with a "c"
(signed char) objcType, but apparently on 32-bit platforms this ends up
as "i" (signed int). Rather than relying on this working properly just
test that [NSNumber numberWithBool:] does the right thing.
* Fix field_value_test on 32-bit targets
When sizeof(void*) is 4 the test failed :-(.
* Rephrase testWritesWithLargeNumbersFail in terms of fixed size types
The prior definition only worked on LP64. Switching to LLONG_MAX would
have also fixed this, but Firestore's data model is independent of C's
data model, so rewriting this in terms of fixed size types more closely
models what's actually an invalid value.
* Fix implicit retain self warnings
Also eliminate most usages of `FSTDocumentKey`, remove most methods from the Objective-C class and make it just a wrapper over `DocumentKey`. The only usage that cannot be directly replaced by C++ `DocumentKey` is in `FSTFieldValue`.
* 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.
* 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 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
* 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
* add converter function between two DocumentKey implementations
* add unit test
* address changes
* fix lint
* using DocumentKey in model except for the container types `FSTDocumentDictionary`, `FSTDocumentKeySet`, and `FSTDocumentVersionDictionary`
* change other place w.r.t. the use of `DocumentKey` in model
* update parameter of test helpers from NSString to string_view
* revert a temporary change used in debug
* address changes
* 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 FIRFirestoreTests to the Firestore Xcode project
* Avoid waitForExpectations:timeout:
This API was added in Xcode 8.3, but we still build production releases
with Xcode 8.2. waitForExpectationsWithTimeout:handler: is available
from Xcode 7.2.
* Add AppForUnitTesting
Add a utility for constructing a Firebase App for testing.
* Handle the nil UID from FIRAuth
* Avoid running CMake tests twice
* Only build app_testing on Apple platforms
* Revise test.sh messages
- FSTTimestamp is now FIRTimestamp, under Firestore/Source/{Public,API}. This is a temporary solution; eventually, FIRTimestamp is supposed to live somewhere under Firebase;
- move most internal Timestamp methods to the public header (the only exception is ISOString).