| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Track operation in progress FSTDispatchQueue
... and allow dispatchAsync onto the worker queue even from the same
queue if an operation is not in progress. Fixes #753.
This fixes a corner case that happens when users pass us an object and
we retain that object in a block submitted to the worker queue for
processing. Users are not obligated to retain that object themselves.
This can lead to the object's destructor (or dealloc or deinit) being
called on the Firestore worker thread. If that destructor makes
Firestore API calls (most likely ListenerRegistration.remove but any are
possible) this will trigger the assertion.
|
|
|
|
| |
Wraps encoding of FieldValue "Objects" (i.e. map<string, FieldValue>'s)
and their entries (i.e. pair<string, FieldValue>'s)
|
| |
|
|
|
| |
Wraps encoding nested messages.
|
|
|
| |
Uses a custom pb_ostream_t. Previously used a stack allocated 1k buffer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix ArraySortedMap.ChecksSize test (when NDEBUG is enabled)
assert() is a noop when NDEBUG is defined (i.e. during production
builds) so the size assertion check doesn't occur. Assuming we want this
check even during prod use, I've switched assert to FIREBASE_ASSERT.
* s/FIREBASE_ASSERT/FIREBASE_DEV_ASSERT/g in ordered_code.cc
This keeps the behaviour in line with the original (which purposely
differs if NDEBUG is defined or not.) Discovered due to the test suite
(correctly) breaking during a prod build.
|
|
|
|
|
|
|
|
| |
Port of: https://github.com/firebase/firebase-js-sdk/pull/559
Should address #772 once released.
getNextMutationBatchAfterBatchId() was not respecting
highestAcknowledgedBatchId and therefore we were resending writes after the
network was disabled / re-enabled.
|
|
|
| |
Wraps the string encode method.
|
|
|
| |
Wraps the varint based encode methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Version bumps for Firebase 4.10.1 (#891)
* Minimal fix for b/74357976 (#890)
Fixes b/74357976 which caused unauthenticated users to be unable to reach the Firestore backend and updates the changelog.
* Copy all C++ strings to NSString where they're not obviously safe (#893)
This fixes a known instances of memory corruption where in
FSTLevelDBMutationQueue, the NSString view was retained for later, and
the incorrect user was used, causing b/74381054.
gRPC does not necessarily copy its string argumnets and if our hostname
were configured to a non-default one it's possible that we could corrupt
the host cache too.
All remaining usages of util::WrapNSStringNoCopy are obviously safe:
passed into logging or other known transient usages.
* fix lint
|
|
|
| |
These can (recursively) contain other FieldValues.
|
|
|
|
|
|
| |
* Add a universal build script
* Rewrite test.sh in terms of universal build
|
|\
| |
| | |
Merge Release 4.10.0 into Master
|
| |
| |
| |
| |
| |
| |
| |
| | |
* replace path with C++ implementation in FSTDocumentKey.{h,mm} only
* address changes
* address changes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
offline. (#872)
[Port of https://github.com/firebase/firebase-js-sdk/commit/0fa319e5e019dd0d40ab441d2ff9f8f6d4724e43]
* Refactored FSTOnlineState tracking out of FSTRemoteStore and into new
FSTOnlineStateTracker component.
* Added a 10 second timeout to transition from OnlineState.Unknown to
OnlineState.Offline rather than waiting indefinitely for the stream to
succeed or fail.
* Removed hack to run SpecTests using an FSTDispatchQueue that wrapped
dispatch_get_main_queue(). This was incompatible with [FSTDispatchQueue
runDelayedCallbacksUntil:] since it queues work and blocks waiting for
it to complete. Now spec tests create / use a proper FSTDispatchQueue.
* Added a SpecTest to verify OnlineState timeout behavior.
* Misc cleanup:
* Renamed FSTOnlineState states: Failed => Offline, Healthy => Online
* Renamed FSTTimerIds (ListenStreamConnection => ListenStreamConnectionBackoff)
* Added ability to run timers from spec tests.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |
| |
| |
| |
| |
| |
| |
| | |
This will likely only apply for proto messages that use 'oneof's. (Because we need to serialize these manually.)
The problem was that as we were adding additional types, TypeValue was evolving into a parallel implementation of the FieldValue union.
When serializing/deserializing oneofs we need to supply a custom value to serialize and a custom function to do the work. There's no value in translating from FieldValue to TypeValue just to store as this custom object. We might as well just store the FieldValue model directly and write the custom serializer/deserializer to use the model directly.
|
|/ |
|
|\
| |
| | |
Report FirebaseCore version
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix bash style issues
* Exclude additional build output directories
* Format swift files with scripts/style.sh
* Reformat swift sources
* Allow swiftformat 0.32.0 on travis
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add Firestore_SwiftTests_iOS target to Xcode
* Add FirebaseFirestoreSwift podspec
* Add Firestore_SwiftTests_iOS to the Podfile
* Add CodableGeoPoint and tests
* Version FirebaseFirestoreSwift separately
|
|
|
| |
Was failing the cmake build on linux.
|
| |
|
|
|
|
|
|
|
|
| |
Since we can't decode a value before knowing it's type, I've pulled the
tag handling out of these methods.
More context over here:
https://github.com/firebase/firebase-ios-sdk/pull/829
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
* Avoid wrapping and rewrapping NSStrings when constructing DatabaseId
* Shorten DatabaseId::kDefaultDatabaseId
|
| |
|
|
|
|
| |
Reduces noise while running valgrind so that I can see the leaks that
I'm introducing. :/
|
| |
|
|
|
|
|
|
| |
Xcode has starting warning about us implicitly retaining self references
within blocks. This commit fixes it by explicitly mentioning self. No
real changes are introduced here; this is effectively just making
implicit behaviour explicit.
|
|
|
|
| |
- 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).
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [En|De]codeUnsignedVarint -> [En|De]codeVarint
The 'unsigned' portion was misleading, as these varints work with both
signed and unsigned integers. (The 'signed' varints also work with both
signed and unsigned integers, but use zig-zag encoding so that negative
numbers are encoded more efficiently. Note that 'signed' varints aren't
used in the Value proto, so won't appear in the serializer class for at
least the short term.)
Added some docstrings to help disambiguate this.
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix b/73167987: Upon receiving a permanent write error when we had additional
pendingWrites to send, we were restarting the stream with a new delegate and
then immediately setting the delegate to nil, causing the stream to ignore
all GRPC events for the stream.
* Fix b/73382103: We were attempting to gracefully teardown the write stream (i.e.
send an empty WriteRequest) even when the stream was already failed due
to an error. This caused no harm other than log pollution, but I fixed it.
* Use -[GRPCCall setResponseDispatchQueue] to dispatch GRPC callbacks directly onto the Firestore worker queue. This saves a double-dispatch and simplifies our logic.
* Add stricter assertions regarding stream state now that dispatch queue / callback filter race conditions are eliminated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* replacing Auth/FSTUser by C++ auth implementation
* address changes
* replacing FSTGetTokenResult by C++ Token implementation
* address changes
* address changes
* fix another const& v.s. dispatch bug
* fix more const& v.s. dispatch bug zxu123 committed
* fix
* passing by value in callback
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* replacing Auth/FSTUser by C++ auth implementation
* address changes
|
|\ |
|
| |
| |
| |
| | |
we're going to. (#790)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Build (grpc's) nanopb with -DPB_FIELD_16BIT
We require (at least) 16 bit fields. (By default, nanopb uses 8 bit
fields, ie allowing up to 256 field tags.)
Also note that this patch adds this to grpc's nanopb, rather than to our
nanopb. We'll need to eventually either:
a) we instruct grpc to use our nanopb
b) we rely on grpc's nanopb instead of using our own.
(^ marked as a TODO for now.)
* Add some dependant protos
Imported from protobuf. Nanopb requires these to be present (though
anything using libprotobuf does not, as these are already built into
that.)
* Add generated nanopb protos based off of newly added proto definitions
* Build the nanopb protos
* Serialize and deserialize null
|