aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore
Commit message (Collapse)AuthorAge
* port `DocumentKey` to non-container types of `Model/*` (#930)Gravatar zxu2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Implements transactions for leveldb (#881)Gravatar Greg Soltis2018-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start work on leveldb transactions * Style * Working API. Not plumbed in yet * Move files into correct place * Wrangling file locations and associations * Tests pass * Add some comments * style * Fix copyright * Rewrite iterator internals to handle deletion-while-iterating. Also add tests for same * Switch to strings instead of slices * Style * More style fixes * Response to feedback before updating docs * Style * Add comment * Initialize version_ * Satisfy the linter * Fix style * snake_case * More snakes * LevelDBTransaction -> LevelDbTransaction
* Move core/types.h to model to prevent a core -> local -> core dependency ↵Gravatar Gil2018-03-15
| | | | cycle (#929)
* adding converters between DocumentKey (#900)Gravatar zxu2018-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Move creation of pb_ostream_t's into Writer (#920)Gravatar rsgowman2018-03-15
| | | | | | | | | | * Move creation of pb_ostream_t's into Writer Writer now owns these structs * Writer::FromBuffer -> Writer::Wrap * add todo for possible future simplification.
* Partial wrapping of pb_ostream_t (pt5) (#916)Gravatar rsgowman2018-03-14
| | | | Wraps encoding of FieldValue's. At this point, raw pb_ostream_t structs aren't used outside of Writer, except during creation of a Writer.
* Add a CHANGELOG entry for fixed absl symbols (#918)Gravatar Gil2018-03-14
|
* grand PR to port the remaining paths (FieldPath and ResourcePath). (#865)Gravatar zxu2018-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Defend against users making API calls during deinit (#863)Gravatar Gil2018-03-13
| | | | | | | | | | | | | | 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.
* Partial wrapping of pb_ostream_t (pt4) (#915)Gravatar rsgowman2018-03-13
| | | | Wraps encoding of FieldValue "Objects" (i.e. map<string, FieldValue>'s) and their entries (i.e. pair<string, FieldValue>'s)
* Update CHANGELOG for Firestore v0.10.4 (#914)Gravatar Gil2018-03-13
|
* Partial wrapping of pb_ostream_t (pt3) (#907)Gravatar rsgowman2018-03-13
| | | Wraps encoding nested messages.
* Allow serializing arbitrary length FieldValues (#889)Gravatar rsgowman2018-03-12
| | | Uses a custom pb_ostream_t. Previously used a stack allocated 1k buffer.
* Fix test failures that occur during prod build (#910)Gravatar rsgowman2018-03-12
| | | | | | | | | | | | | | * 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.
* Fix MutationQueue issue resulting in re-sending acknowledged writes. (#909)Gravatar Michael Lehenbauer2018-03-12
| | | | | | | | 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.
* Partial wrapping of pb_ostream_t (pt2) (#903)Gravatar rsgowman2018-03-12
| | | Wraps the string encode method.
* Partial wrapping of pb_ostream_t (pt1) (#899)Gravatar rsgowman2018-03-09
| | | Wraps the varint based encode methods.
* Merge Release 4.10.1 into Master (#896)Gravatar zxu2018-03-09
| | | | | | | | | | | | | | | | | | | | | | | * 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
* [De]Serialize FieldValue map_values ("Objects") (#878)Gravatar rsgowman2018-03-08
| | | These can (recursively) contain other FieldValues.
* Factor out a universal build script (#884)Gravatar Gil2018-03-07
| | | | | | * Add a universal build script * Rewrite test.sh in terms of universal build
* Merge pull request #880 from firebase/release-4.10.0Gravatar Paul Beusterien2018-03-06
|\ | | | | Merge Release 4.10.0 into Master
* | port paths to FSTDocumentKey (#877)Gravatar zxu2018-03-06
| | | | | | | | | | | | | | | | * replace path with C++ implementation in FSTDocumentKey.{h,mm} only * address changes * address changes
* | Add 10 second timeout waiting for connection before client behaves as-if ↵Gravatar Michael Lehenbauer2018-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 port paths to FSTQuery (#869)Gravatar zxu2018-03-05
| | | | | | | | | | | | | | | | | | | | * 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
* | Serialize (and deserialize) string values (#864)Gravatar rsgowman2018-02-28
| |
* | Add FieldValue.boolean_value() (#862)Gravatar rsgowman2018-02-27
| |
* | replacing Auth by C++ auth implementation (#802)Gravatar zxu2018-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Eliminate TypedValue and serialize direct from FieldValue to bytes. (#860)Gravatar rsgowman2018-02-27
| | | | | | | | | | | | | | | | 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.
| * Version bumps for Firebase 4.10.0 (#859)Gravatar Paul Beusterien2018-02-27
|/
* Merge pull request #851 from firebase/bs-firebasecore-versionGravatar Benoit St-Pierre2018-02-26
|\ | | | | Report FirebaseCore version
* | Update CHANGELOG for Firestore v0.10.2 (#856)Gravatar Gil2018-02-26
| |
| * Style fixesGravatar Benoit St-Pierre2018-02-26
|/
* Auto-style swift sources (#847)Gravatar Gil2018-02-26
| | | | | | | | | | | * 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 build infrastructure for Codable support in Firestore (#815)Gravatar Gil2018-02-26
| | | | | | | | | | | | * Add Firestore_SwiftTests_iOS target to Xcode * Add FirebaseFirestoreSwift podspec * Add Firestore_SwiftTests_iOS to the Podfile * Add CodableGeoPoint and tests * Version FirebaseFirestoreSwift separately
* Don't build firebase_firestore_testutil_apple on non-apple platforms. (#841)Gravatar rsgowman2018-02-22
| | | Was failing the cmake build on linux.
* Fix lint warnings (#840)Gravatar Gil2018-02-22
|
* Refactor [En|De]codeVarint to be symetric wrt tags (#837)Gravatar rsgowman2018-02-22
| | | | | | | | 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
* Avoid warnings about failing to override a designated initializer (#832)Gravatar Gil2018-02-22
|
* Fix Firestore tests for M22 (#834)Gravatar Gil2018-02-22
| | | | | | | | | | | | | | | | | | | | | | * 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 (#833)Gravatar Gil2018-02-22
| | | | | | * Avoid wrapping and rewrapping NSStrings when constructing DatabaseId * Shorten DatabaseId::kDefaultDatabaseId
* Serialize (and deserialize) int64 values (#818) (#829)Gravatar rsgowman2018-02-22
|
* Fix trivial mem leak in the test suite (#828)Gravatar rsgowman2018-02-21
| | | | Reduces noise while running valgrind so that I can see the leaks that I'm introducing. :/
* Accept FIRTimestamp where NSDate is currently accepted as a parameter (#823)Gravatar Konstantin Varlamov2018-02-21
|
* Fix implicit retain self warnings (#808)Gravatar rsgowman2018-02-21
| | | | | | 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.
* Make FSTTimestamp into a public Firestore class (#698)Gravatar Konstantin Varlamov2018-02-20
| | | | - 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 (#817)Gravatar rsgowman2018-02-20
| | | | | | | | | | | | * [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 two stream close issues (b/73167987, b/73382103). (#810)Gravatar Michael Lehenbauer2018-02-20
| | | | | | | | | | | * 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 FSTGetTokenResult by C++ Token implementation (#805)Gravatar zxu2018-02-20
| | | | | | | | | | | | | | | | | | | | * 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
* Delete stale Firestore instances after FIRApp is deleted. (#809)Gravatar Ryan Wilson2018-02-16
|
* Serialize (and deserialize) bool values (#791)Gravatar rsgowman2018-02-16
|