* Add the ability to await a single expectation
* Await individual expectations in test helpers
This prevents tests from accidentally awaiting unrelated expectations
when using the helpers.
* Fix tests that implicitly relied on test helpers to await all
* Add a test that verifies ListenerRegistration::Remove blocks
* Block ListenerRegistration::Remove when there are outstanding callbacks.
* Test that remove does not block when called from the callback.
* 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).
* Fix unused variable warnings
These are now exposed because libprotobuf is no longer polluting the
compiler command-line with -Wno-unused-parameter.
* Convert (void)var to __unused where possible
* 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.
This includes fixes for:
* All the field escaping tests
* testCanWriteVeryLargeBatches
* testWritesWithIndirectlyNestedArraysSucceed
All tests now pass. I've left isRunningAgainstEmulator in the source
even though there are now no callers.
* 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
* 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
[Port of https://github.com/firebase/firebase-js-sdk/pull/1197]
1. Changed MAX_WATCH_STREAM_FAILURES to 1 per conversation with @wilhuff and
@jdimond.
2. Fixed a "race" where when a get() triggered a watch stream error, we'd
restart the stream, then get() would remove its listener, and so we had no
listener left once the watch stream was "opened". Without a listen to send
we'd be stuck in Offline state (even though we should be Unknown whenever
we have no listens to send), resulting in the next get() returning data
from cache without even attempting to reach the backend.
* 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.
Basically a port of https://github.com/firebase/firebase-js-sdk/commit/a1e346ff93c6cbcc0a1b3b33f0fbc3a7b66e7e12 and https://github.com/firebase/firebase-js-sdk/commit/fce4168309f42aa038125f39818fbf654b65b05f
* Introduces a DelayedCallback helper class in FSTDispatchQueue to encapsulate delayed callback logic.
* Adds cancellation support.
* Updates the idle timer in FSTStream to use new cancellation support.
* Adds a FSTTimerId enum for identifying delayed operations on the queue and uses it to identify our existing backoff and idle timers.
* Added containsDelayedCallback: and runDelayedCallbacksUntil: methods to FSTDispatchQueue which can be used from tests to check for the presence of a callback or to schedule them to run early.
* Removes FSTTestDispatchQueue and changes idle tests to use new test methods.
* 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