aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/SpecTests
Commit message (Collapse)AuthorAge
* Add spec test support for target-scoped resume tokens (#1498)Gravatar Sebastian Schmidt2018-07-06
|
* Refactor Remote Event (#1396)Gravatar Sebastian Schmidt2018-06-12
|
* Replace Objective-C assertions with C++ assertions (#1327)Gravatar Gil2018-05-24
| | | | | | | | * Migrate FSTFail to HARD_FAIL * FSTCFail -> HARD_FAIL * FSTCAssert -> HARD_ASSERT * FSTAssert -> HARD_ASSERT * Replace FSTAssert with NSAssert in dead Objective-C code * Remove FSTAssert.h
* Fix Objective-C logging (#1322)Gravatar Gil2018-05-23
|
* Reimplement C++ logging (#1313)Gravatar Gil2018-05-23
| | | | | | | * Add direct support for formatting Objective-C objects * Rewrite log.h * Convert FSTWarn to LOG_WARN * Convert FSTLog to LOG_DEBUG * Remove FSTLogger
* Port FSTDocumentKeySet to C++ DocumentKeySet (#1229)Gravatar Gil2018-05-05
| | | | | | | | | * Define a Comparator for DocumentKey * Automated migration from FSTDocumentKeySet to DocumentKeySet * Manual fixups for DocumentKeySet * Delete FSTDocumentKeySet
* Bump sequence numbers when receiving a new resume token (#1214)Gravatar Greg Soltis2018-05-03
| | | | | | | | * Bump sequence number on resume token refresh * Style * Fix comment formatting
* Port `SnapshotVersion` for the rest Firestore modulo (#1185)Gravatar zxu2018-05-01
| | | | | | | | | | | | | | * remove conversions in `Local` and `Remote` * replace `FSTSnapshotVersion` in `Model` * replace `FSTSnapshotVersion` in the rest * let test check equal with C++ equal * fix newly added code * address changes
* Port `SnapshotVersion` for `Remote` (#1174)Gravatar zxu2018-04-25
| | | | | | | | | | | | | | | | | | | | * no-brainer replace FSTSnapshotVersion by SnapshotVersion in `Remote` * delete `FSTSnapshotVersion` in `Remote` * fix test * partially revert RemoteEvent * Revert "partially revert RemoteEvent" This reverts commit 67e35bb6c11eaf79608df8d02a60788a40331d0f. * fix a bug * fix integration * address changes
* Port `SnapshotVersion` for `Local` (#1182)Gravatar zxu2018-04-25
| | | | | | | | | | | | * no-brainer replace `FSTSnapshotVersion` with `SnapshotVersion` * refresh code * fix LocalStore * fix LocalStore (partial revert 78e6c38) * address changes
* 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
* Remove unused shutdown methods (#993)Gravatar Greg Soltis2018-03-29
| | | | | | | | | | | | * Drop mutation queue shutdown * Drop query cache shutdown * Drop remote document cache shutdown * Drop local store shutdown * drop newline
* 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
* Fix issue that could cause offline get()s to wait up to 10 seconds. (#978)Gravatar Michael Lehenbauer2018-03-26
| | | | | | | | | Port of https://github.com/firebase/firebase-js-sdk/pull/592 FSTOnlineStateTracker was reverting to OnlineState Unknown on every stream attempt rather than remaining Offline once the offline heuristic had been met (i.e. 2 stream failures or 10 seconds). This means that getDocument() requests made while offline could be delayed up to 10 seconds each time (or until the next backoff attempt failed).
* Fix for b/74749605: Cancel pending backoff operations when closing streams. ↵Gravatar Michael Lehenbauer2018-03-21
| | | | | (#958) Port of https://github.com/firebase/firebase-js-sdk/pull/564.
* Fix FSTTimerID strings in spec tests to match constants used in web. (#953)Gravatar Michael Lehenbauer2018-03-20
|
* 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
* 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
* 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.
* 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.
* 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
* 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
* replacing Auth/FSTUser by C++ auth implementation (#804)Gravatar zxu2018-02-15
| | | | | | * replacing Auth/FSTUser by C++ auth implementation * address changes
* Implement Firestore DatabaseInfo and port both Database{Id,Info} C++ to the ↵Gravatar zxu2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iOS code (#738) * implement Firestore DatabaseInfo in C++ * temporary stash changes; blocking on the massive renaming of .m to .mm * add database_info_test to project * finish port DatabaseId and fix style, modular fixing DatabaseInfo * port DatabaseInfo * remove FSTDatabase{ID,Info} and their tests from project * fix unit test * use namespace alias * use namespace alias, leftover * address more changes * refactoring to use raw pointer instead of value for property * address changes * remove self-> * fix style * remove the name suffix Alloc * fix a bug
* Move all Firestore Objective-C to Objective-C++ (#734)Gravatar Gil2018-01-31
| | | | | | | | | | | | | | * 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
* Fix b/72502745: OnlineState changes cause limbo document crash. (#470) (#714)Gravatar Michael Lehenbauer2018-01-27
| | | | | | | | | | | | | | | | | | | | [PORT OF https://github.com/firebase/firebase-js-sdk/pull/470] Context: I made a previous change to raise isFromCache=true events when the client goes offline. As part of this change I added an assert for "OnlineState should not affect limbo documents", which it turns out was not valid because: * When we go offline, we set the view to non-current and call View.applyChanges(). * View.applyChanges() calls applyTargetChange() even though there's no target change and it recalculates limbo documents. * When the view is not current, we consider no documents to be in limbo. * Therefore all limbo documents are removed and so applyChanges() ends up returning unexpected LimboDocumentChanges. Fix: I've modified the View logic so that we don't recalculate limbo documents (and generate LimboDocumentChanges) when the View is not current, so now my assert holds and there should be less spurious removal / re-adding of limbo documents.
* Cleanup imports and isEqual (#685)Gravatar Gil2018-01-21
| | | | | | | | | | * Fix headers * Fix isEqual verbosity * Fix isEqual for nullable properties * Fix nullability on FSTTestDocSnapshot
* Listen sequence numbers (#675)Gravatar Greg Soltis2018-01-17
| | | | | | | | | | | | * Generate and save sequence numbers for listens * Add documentation * Fix include path * Fix unavailable comment * Review feedback
* Fix import formatting (#660)Gravatar Paul Beusterien2018-01-12
|
* Rename all the onlineStateChanged methods to applyChangedOnlineState. (#574)Gravatar Michael Lehenbauer2017-12-19
|
* Firestore `isEqual()` on Public Types (#569)Gravatar zxu2017-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add bone code for new isEqual and unit test for old isEqual * add bone code for `FIRCollectionReference`, `FIRDocumentSnapshot`, `FIRFieldValue`, `FIRQuerySnapshot`, `FIRSnapshotMetadata`; * change inconsistenciness of `FIRFieldPath.isEqual` implementation; * add unit test (and file) for `FIRDocumentReferenceTest.m`, `FIRFieldPathTest.m`, `FIRQueryTests.testEquals`; `FIRGeoPoint` already has test and Blob is internal type. * Implement isEqual for FIRCollectionReference adding the working code and unit test. * implement isEqual for FIRSnapshotMetadata * Implement isEqual for FIRDocumentSnapshot * Implement isEqual for FIRQuerySnapshot * (un)implement `isEqual` for `FIRFieldValue` Since `FIRFieldValue` both types are singleton, we do not need override `isEqual`. Add test to test the default `NSObject` `isEqual` works just fine. * fix style with `scripts/style.sh` * Implement hash for those with overridden isEqual without hash yet. * refactor to use test helper functions -- FSTTestFirestore, FSTTestPath, FSTTestDocKey * refactor using test helper `FSTTestDocSnapshot`, `FSTTestFieldPath`, `FSTTestQuery`, `FSTTestDoc` * refactoring to use test helper method `FSTTestQuerySnapshot`, * remove unneccessary nil-check, check isKindOfClass instead of isEqual * refactoring: adding `FSTAPIHelpers.{h,m}`, `FSTTest{Collection,Document}Ref`, better naming and style fix * a file forgot in last commit * mainly clean up import and some minor refactoring * fix style via style.sh * minor style fix * add pragma ignored -Wnonnull
* b/68276665: Raise isFromCache=true events when offline (#567)Gravatar Michael Lehenbauer2017-12-15
| | | | | | | | | | | | | | | | * Plumbs FSTOnlineState changes through to views. * View sets this.current to false on FSTOnlineStateFailed, triggering isFromCache=true events. It will automatically be returned to true once the listen is reestablished and we get a new CURRENT message. * Updated tests (and added one new one) to verify behavior. * Unifies setOnlineStateToUnknown, setOnlineStateToHealthy, and updateAndBroadcastOnlineState into a single updateOnlineState method. * Split disableNetwork into (public) disableNetwork and (private) disableNetworkWithTargetOnlineState methods.. * Some miscellaneous comment cleanup. * Add missing comment per CR feedback.
* Buildable and interoperable source pods (#444)Gravatar Paul Beusterien2017-11-21
|
* Use fully qualified imports in Firestore (#467)Gravatar Gil2017-11-16
| | | | | | | | | This simplifies the import process back into google3 and allows us to add additional directories to the project without needing to update the project files for each directory we add. This shows up most clearly in the change to Firestore/Example/Firestore.xcodeproj/project.pbxproj: this no longer needs to list essentially every directory in the project as a header search path. * Clang-format configuration for C++ files * Add support C++-only sources to the podspec * Podspec support for fully qualified imports * xcodeproj changes for fully-qualified imports * Use fully-qualified imports in Firestore sources
* Additional support for C++ sources in Firestore (#462)Gravatar Gil2017-11-16
| | | | | * Fix up style from previous PRs * Clang-format configuration for C++ files * Add support C++-only sources to the podspec
* Clang-formatting StorageGravatar Sebastian Schmidt2017-11-09
|
* Sending an empty write request before tearing down the stream (#438)Gravatar Sebastian Schmidt2017-11-08
|
* Moving the Stream class to their own file (#418)Gravatar Sebastian Schmidt2017-10-31
|
* Closing the write and watch stream after 60s of idleness (#388)Gravatar Sebastian Schmidt2017-10-30
|
* Moving the StreamTest to integration tests (#391)Gravatar Sebastian Schmidt2017-10-24
|
* Port of fix for b/67042460 (retry more often before considering client ↵Gravatar Michael Lehenbauer2017-10-23
| | | | | | offline) (#403) This ensures FSTRemoteStore always tries to connect at least twice before surfacing an FSTOnlineStateFailed event to external code (which may trigger gets to fail, cached data to be surfaced, etc.).
* Release 4.3.0 (#327)Gravatar Gil2017-10-03
Initial release of Firestore at 0.8.0 Bump FirebaseCommunity to 0.1.3