Commit Graph
29 Commits
Author SHA1 Message Date
Gil 7ef9914ff9 Fix TSAN violations in FSTTransactionTests (#5922)
TSAN uncovered cases where we were reading values in the transaction
thread that were set on the main thread and were unprotected by lock. In
practice this is unlikely to cause an harm, but it's good to keep TSAN
clean for when there are real issues.
2020-06-25 17:28:24 -07:00
Gil 1df5574c4f Upgrade gRPC-C++ to 1.28.0 (#4312)
This unblocks nanopb changes proposed in #4264.

This upgrades everything in the gRPC constellation of dependencies to match gRPC at 1.28:

  * gRPC to 1.28.0 (note that gRPC 1.28.1, while released, is a fix for just the python binding and there's no gRPC-C++ CocoaPod at that version)
  * Abseil to 20200225 (as of gRPC 1.27 this is now a gRPC dependency too; there's a later patch but gRPC doesn't use it yet)
  * Protobuf C++ to 3.11.4 (only used for testing in Firestore)
  * C-Ares to 1.15.0
  * BoringSSL to match (no change between gRPC 1.27.0 and 1.28.0)

Also, this disables CFStream-based transport on Apple platforms. This works around b/133182964, wherein CFStream will occasionally fail to raise a has-bytes-available events, causing Firestore to appear to hang.
2020-04-22 14:03:34 -07:00
Gil 74f4ceb4c9 Fix unused variable warnings (#5389)
* 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
2020-04-20 14:23:36 -07:00
Brian Chen 26430a9086 Check for error code matches in Transaction tests (#5391) 2020-04-16 09:12:42 -07:00
Brian Chen 0a352472a8 Fix flaky transaction tests (#5334) 2020-04-15 14:51:11 -07:00
Paul BeusterienandMarek Gilbert 4ea4340285 Upgrade clang-format (#5265)
Co-authored-by: Marek Gilbert <mcg@google.com>
2020-04-03 11:38:31 -07:00
Brian Chen 9313d61a21 Add verify support (#4658) 2020-01-16 09:57:38 -08:00
Gil 9a4f4e73c7 Miscellaneous fixes (#4584)
* Fix use after move in LevelDbPersistenceForTesting

* Fix size-related errors when compiling in 32-bit mode

* Fix test-only memory leaks

* Fix test-only memory leaks

* Prevent spec tests from appearing to leak

The spec tests aren't actually leaking, but they accumulate enough
garbage without clearing the autorelease pool that Instruments
complains.

* Avoid temporaries in methods that @throw

ARC does not release temporaries when an Objective-C exception is
thrown. Use C++ equivalents directly to avoid leaks as detected by
Instruments.

* Fix memory leak in acknowledge mutation

Any previous value must be freed before the next one is assigned.

* Manually implement assignment operators in ByteString

The single by-value implementation wasn't preventing the compiler
generated standard versions from being generated which was causing
leaks.

* Prevent leaking GrpcCompletions that complete after Shutdown

After shutdown, the AsyncQueue silently drops Enqueue requests which
prevents these blocks from being deleted.

* Avoid racing with enqueued operations

It's possible for the Executor to immediately execute the given block,
at which point the block might observe the async queue in a
not-shutting-down state.
2020-01-08 07:11:05 -08:00
Gil df3989b8a2 Fix lint warnings spotted by google3's linter (#4538) 2019-12-31 11:35:51 -06:00
Gil e7172d5f09 Post-migration cleanups (#4451)
* Fix naming violations.

* Remove xcgmock

* Remove FSTTypes.h

* Remove FSTClasses.h
2019-12-07 18:33:18 -08:00
wu-hui dff57b6048 Enable -Werror for Firestore XCode project (#3836) 2019-09-13 12:39:18 -07:00
wu-hui 7870c73b7c Port FSTFirestoreClient to C++ 2/2 (#3657)
* firestore_client + FSTFirestoreClient becomes delegate.

* fix comment

* addressing comment

* use new instead make_shared

* reformat

* Update references to firestore client

* Addressing comments#2

* addressing comments #3

* add std::move

* remove deleted header.

* fix cmake build error.
2019-08-26 15:48:18 -04:00
Brian Chen c7777be93c Retrying transactions with backoff (#3599) 2019-08-21 11:12:09 -07:00
Brian Chen e520b78a53 Fix flaky integration test (#3470) 2019-07-30 11:57:51 -07:00
Brian Chen b9113f500e Only retry transactions on non-permanent errors (#3443) 2019-07-27 09:46:42 -07:00
Brian Chen 9efd84392b Fix preconditions in transactions (#3429) 2019-07-25 14:12:29 -07:00
Brian Chen a2f0cf9678 Throw last failed attempt's error in failed transactions (#3287) 2019-07-09 11:34:55 -07:00
Gil 12b7397e4b Upgrade to Firestore Emulator 1.5.0 (#3171)
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.
2019-06-11 13:34:49 -07:00
Gil c866936c7d Upgrade the emulator we use for integration testing to 1.4.6 (#3038)
* Bump to cloud-firestore-emulator 1.4.6
* Re-enable transform-related integration tests against the emulator
* Re-enable collection-group query integration tests
* Re-enable most transaction-related tests
2019-05-20 21:42:58 -07:00
Gil 547ed27027 Add support for running Firestore integration tests against the emulator (#2922) 2019-05-03 07:55:57 -07:00
Konstantin Varlamov c422806d8e C++ migration: port FSTTransaction (#2362) 2019-02-11 19:12:52 -05:00
Michael Lehenbauer 2ad5e1c1b9 Fix b/119570746: Transaction get returns nil if document does not exist (#2236)
This makes the iOS behavior match Web and Android, returning a non-nil
snapshot with exists=false, rather than a nil snapshot.
2019-01-07 17:46:43 -08:00
Paul Beusterien 7c53489e03 Travis to Xcode 10.1 and clang-format to 8.0.0 (tags/google/stable/2018-08-24) (#2222)
* Travis to Xcode 10.1
* Update to clang-format 8
* Update clang-format homebrew link
* Work around space in filename style.sh issue
2019-01-02 09:27:31 -08:00
zxu 48e5f7a33b enable disabled passed integration test (#2120)
* enable disabled passed integration test

* address comment
2018-11-26 18:28:31 -05:00
Gil 2813ac30da Fix analyze issues in Firestore (#1763)
* Fix analyzer errors in Firestore

* Add testutil to IntegrationTests
2018-08-29 12:09:52 -07:00
Michael Lehenbauer b88f95c44f Reformat using 'clang-format version 7.0.0 (tags/google/stable/2018-04-24)' (#1681)
This is the version of clang-format that travis is currently using.
2018-08-13 14:18:02 -07:00
Gil 5368c9e22f Replace the SetOptions object with a simple boolean. (#1098)
Instead of calling

  `setData(["a": "b"], options: SetOptions.merge())`

call

  `setData(["a": "b"], merge: true)`
2018-04-15 13:06:06 -07:00
Benoit St-Pierre 3d03426e0e Style fixes 2018-02-26 15:58:37 -05:00
Gil 729b8d176c Move all Firestore Objective-C to Objective-C++ (#734)
* 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
2018-01-31 11:23:55 -08:00