aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core
Commit message (Collapse)AuthorAge
...
* Add lint checking for Objective-C++ sources (#1048)Gravatar Gil2018-04-09
| | | | | | | | | | | | | | | | * 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
* Fix build breakage on linux (#997)Gravatar rsgowman2018-04-05
|
* Add error handling for serializer (for serializing case only) (#991)Gravatar rsgowman2018-04-05
| | | | | | | | Deserializing not handled yet. Note that the serializing case is fairly uninteresting, as assuming valid input is passed in, there's no real reason why it should fail (and if it does fail, it indicates a gross violation of our understanding of the system.)
* Port transform operations to C++ (#1020)Gravatar zxu2018-04-05
| | | | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * Port transform operations (FSTTransformOperation, FSTServerTimestampTransform) to C++ * address changes * address changes * address changes * address change
* port FieldMask to C++ (#998)Gravatar zxu2018-04-04
| | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * fix lint * address changes * Revert "address changes" This reverts commit c75bb42851b785ab0838bb23679f87dfad9df4bb.
* Fix optimized build missing symbol issue (#1009)Gravatar Paul Beusterien2018-03-30
|
* Drop FSTWriteGroup (#986)Gravatar Greg Soltis2018-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Drop write group from remote document change buffer * Unwind some group dependendencies in local store * Write group dropped from local store * Drop write group from mutation queue tests * Drop write group usage from query cache tests * Drop write groups from remote document cache tests * Drop write groups from remote document change buffer tests * Drop write groups and the write group tracker * Style * Put the action in transaction * Merge master, fix test * Fix some compiler warnings but mostly trigger travis * Responses to feedback
* C++ migration: refactor Timestamp logic checking for overflow. (#1000)Gravatar Konstantin Varlamov2018-03-29
| | | | | Rewrite manual checks using `<chrono>` min()/max() functions and duration_cast. This is cleaner and avoids including <limits>.
* C++ migration: fix some Timestamp tests failing on Linux. (#999)Gravatar Konstantin Varlamov2018-03-29
| | | | | | | | | | | | Some Timestamp tests check that constructor fails if given values beyond the supported (pretty wide) range. In case Timestamp is created from chrono::time_point, the time_point's underlying duration is implementation-defined and may overflow when tests try to set it to a value beyond Timestamp supported range. To work around this, make these tests not run if time_point cannot represent boundary values on this platform. For example, on OS X, time_point has microseconds precision, so the tests may run, but on Linux, time_point has nanoseconds precision, which would overflow.
* Clean up usages of std::make_unique that crept in (#996)Gravatar Gil2018-03-29
| | | | | | | | * Add std::make_unique rule * Clean up usages of std::make_unique that crept in This fails to build under Xcode 8.2
* Initial TreeSortedMap and SortedMap in C++ (#980)Gravatar Gil2018-03-29
| | | | | | | | | | * Prepare for TreeSortedMap * Factor out SortedMapBase * Move ArraySortedMap to impl * Factor out SortedMap testing utilities * Add a minimal TreeSortedMap * Add the public SortedMap type
* Add ObjectValue::Map alias (#967)Gravatar rsgowman2018-03-27
|
* port C++ DocumentKey to the rest of Firestore code (#977)Gravatar zxu2018-03-27
| | | | | | | | | | * port C++ DocumentKey to API's and Core's * address changes * address changes * fix Hash return types
* C++ migration: make Timestamp class a part of public API (#944)Gravatar Konstantin Varlamov2018-03-27
| | | | | | | | | | | * move Timestamp from model/ to the root directory; * move Timestamp to top-level firebase namespace and update all references; * add conversions to and from native date types; * add a specialization of std::hash; * add comments to public member functions; * rename nanos -> nanoseconds; * add public headers, including Timestamp, to CMake; * increase test coverage.
* Switch LevelDB MutationQueue and RemoteDocumentCache to use transactions (#968)Gravatar Greg Soltis2018-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 * Start switching writegroup over * Swap out write group tracking for transaction usage * Style * Response to feedback before updating docs * Style * Add comment * Initialize version_ * Satisfy the linter * Start switching writegroup over * Swap out write group tracking for transaction usage * Style * Checkpoint before implementing BatchDescription * Style * Initial plumbing for leveldb local parts * Add model::BatchId * Port leveldb_key.{h,cc} * Add string StartsWith * Add leveldb_key_test.cc to the project * Revert back to using leveldb::Slice for read/describe These operations universally operate on keys obtained from leveldb so it's actually unhelpful to force all the callers to make absl::string_views from them. * Everything passing * Drop unused function * Style * STart work on reads * Swap reads in queryCache to use transactions * Fix up tests of querycache * Drop commented out code * Cleanup * Style * Fix up for passing tests * style * Renaming * Style * Start work on ToString for transactions * Add ToString() method to LevelDbTransaction * Style * lint * Fix includes, drop runTransaction * current_transaction -> currentTransaction * LevelDbTransaction::NewIterator now returns a unique_ptr * Style * Revert addition of util::StartsWith * Add log line * Style * Add log line * Style * Add debug log line for commits, drop unused BatchDescription * STart work on reads * Swap reads in queryCache to use transactions * Start on remote documents * Transition mutation queue and remote documents to use transactions * Style * Make everything pass * Make everything pass * Make it compile * Style * Style * Revert name change, use DefaultReadOptions() * Style * Handle iterators returning bad statuses
* Rewrite leveldb_key to use a Reader/Writer class (#960)Gravatar Gil2018-03-24
|
* Renames in serializer to reflect recent changes (#957)Gravatar rsgowman2018-03-23
| | | | | | | * Rename Writer::Encode* methods to Writer::Write* * Rename: s/stream/writer/ (approximately) but only where it applies to Writer (rather than pb_ostream_t).
* Switch FSTLevelDBQueryCache to use transactions (#942)Gravatar Greg Soltis2018-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 * Start switching writegroup over * Swap out write group tracking for transaction usage * Style * Response to feedback before updating docs * Style * Add comment * Initialize version_ * Satisfy the linter * Start switching writegroup over * Swap out write group tracking for transaction usage * Style * Checkpoint before implementing BatchDescription * Style * Initial plumbing for leveldb local parts * Add model::BatchId * Port leveldb_key.{h,cc} * Add string StartsWith * Add leveldb_key_test.cc to the project * Revert back to using leveldb::Slice for read/describe These operations universally operate on keys obtained from leveldb so it's actually unhelpful to force all the callers to make absl::string_views from them. * Everything passing * Drop unused function * Style * STart work on reads * Swap reads in queryCache to use transactions * Fix up tests of querycache * Drop commented out code * Cleanup * Style * Fix up for passing tests * style * Renaming * Style * Start work on ToString for transactions * Add ToString() method to LevelDbTransaction * Style * lint * Fix includes, drop runTransaction * current_transaction -> currentTransaction * LevelDbTransaction::NewIterator now returns a unique_ptr * Style * Revert addition of util::StartsWith * Add log line * Style * Add log line * Style * Add debug log line for commits, drop unused BatchDescription * Fix an include, but mostly try to trigger a travis build
* Change write groups to use transactions (#912)Gravatar Greg Soltis2018-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 * Start switching writegroup over * Swap out write group tracking for transaction usage * Style * Response to feedback before updating docs * Style * Add comment * Initialize version_ * Satisfy the linter * Start switching writegroup over * Swap out write group tracking for transaction usage * Style * Checkpoint before implementing BatchDescription * Style * Everything passing * Drop unused function * Style * Renaming * Style * Add log line * Style * Add debug log line for commits, drop unused BatchDescription
* Add `ToString()` to `LevelDbTransaction` (#946)Gravatar Greg Soltis2018-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial plumbing for leveldb local parts * Add model::BatchId * Port leveldb_key.{h,cc} * Add string StartsWith * Add leveldb_key_test.cc to the project * Revert back to using leveldb::Slice for read/describe These operations universally operate on keys obtained from leveldb so it's actually unhelpful to force all the callers to make absl::string_views from them. * Start work on ToString for transactions * Add ToString() method to LevelDbTransaction * Style * lint * Revert addition of util::StartsWith
* Port FSTLevelDBKey to C++ (#937)Gravatar Gil2018-03-21
|
* Change CredentialsProvider::TokenListener to use StatusOr<Token> (#945)Gravatar rsgowman2018-03-21
| | | | | | | | | | | | | * Change CredentialsProvider::TokenListener to use StatusOr Rather than a token plus error code/msg. * Eliminate the concept of an invalid Token Instead, we'll just use StatusOr<Token>. Note that unauthenticated tokens are handled as a special case; they're created via: Token::Unauthenticated() and are otherwise "valid", though attempting to retrieve the raw token on one of these tokens will cause an assertion failure.
* Add Status and StatusOr (#935)Gravatar rsgowman2018-03-19
| | | | * Pull in status files from tensorflow * Add missing dependency to immutable library
* 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.
* 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
* 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)
* 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.
* 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.
* [De]Serialize FieldValue map_values ("Objects") (#878)Gravatar rsgowman2018-03-08
| | | These can (recursively) contain other FieldValues.
* port paths to FSTDocumentKey (#877)Gravatar zxu2018-03-06
| | | | | | | | * replace path with C++ implementation in FSTDocumentKey.{h,mm} only * address changes * address changes
* 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.
* 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
* 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. :/