diff options
author | Sebastian Schmidt <mrschmidt@google.com> | 2017-12-12 07:11:39 +0800 |
---|---|---|
committer | Sebastian Schmidt <mrschmidt@google.com> | 2017-12-12 07:11:39 +0800 |
commit | 5b1ca51e7264b5ac581c7a0382beb44ed65bdf14 (patch) | |
tree | 8fc0ba38792944b8e6d599eaa11896d66b3801da | |
parent | 64066c643d4e1fff7d00d656201d056f10fb2c36 (diff) |
Addressing comments
-rw-r--r-- | Firestore/CHANGELOG.md | 4 | ||||
-rw-r--r-- | Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m | 6 | ||||
-rw-r--r-- | Firestore/Example/Tests/Util/FSTEventAccumulator.h | 4 | ||||
-rw-r--r-- | Firestore/Source/Model/FSTFieldValue.h | 4 | ||||
-rw-r--r-- | Firestore/Source/Public/FIRDocumentSnapshot.h | 14 |
5 files changed, 18 insertions, 14 deletions
diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index 0c5bcdc..fa2010b 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,3 +1,7 @@ +# Firestore API Branch +- [added] Added SnapshotOptions API to control how DocumentSnapshots return unresolved + server timestamps. + # Unreleased - [changed] Firestore no longer has a direct dependency on FirebaseAuth. - [fixed] Fixed a crash when using path names with international characters diff --git a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m index f2ae687..da3c03c 100644 --- a/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRServerTimestampTests.m @@ -16,8 +16,6 @@ @import FirebaseFirestore; -#import <FirebaseFirestore/FIRDocumentSnapshot.h> -#import <OCMock/OCMArg.h> #import <XCTest/XCTest.h> #import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" @@ -128,7 +126,9 @@ [self expectedDataWithTimestamp:timestamp]); } -/** Verifies a snapshot containing _setData but using the previous field value for the timestamps. +/** + * Verifies a snapshot containing _setData but using the previous field value for server + * timestamps. */ - (void)verifyTimestampsInSnapshot:(FIRDocumentSnapshot *)snapshot fromPreviousSnapshot:(nullable FIRDocumentSnapshot *)previousSnapshot { diff --git a/Firestore/Example/Tests/Util/FSTEventAccumulator.h b/Firestore/Example/Tests/Util/FSTEventAccumulator.h index e32f08b..424f4c8 100644 --- a/Firestore/Example/Tests/Util/FSTEventAccumulator.h +++ b/Firestore/Example/Tests/Util/FSTEventAccumulator.h @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN -typedef void (^FSTValueEventHandler)(id _Nullable, NSError *error); -typedef void (^FSTErrorEventHandler)(NSError *error); +typedef void (^FSTValueEventHandler)(id _Nullable, NSError *_Nullable error); +typedef void (^FSTErrorEventHandler)(NSError *_Nullable error); @interface FSTEventAccumulator : NSObject diff --git a/Firestore/Source/Model/FSTFieldValue.h b/Firestore/Source/Model/FSTFieldValue.h index 9b715a2..93fd5c4 100644 --- a/Firestore/Source/Model/FSTFieldValue.h +++ b/Firestore/Source/Model/FSTFieldValue.h @@ -44,9 +44,9 @@ typedef NS_ENUM(NSInteger, FSTTypeOrder) { /** Defines the return value for pending server timestamps. */ typedef NS_ENUM(NSInteger, FSTServerTimestampBehavior) { + FSTServerTimestampBehaviorNone, FSTServerTimestampBehaviorEstimate, - FSTServerTimestampBehaviorPrevious, - FSTServerTimestampBehaviorNone + FSTServerTimestampBehaviorPrevious }; /** Holds properties that define field value deserialization options. */ diff --git a/Firestore/Source/Public/FIRDocumentSnapshot.h b/Firestore/Source/Public/FIRDocumentSnapshot.h index e8e73c9..994cabf 100644 --- a/Firestore/Source/Public/FIRDocumentSnapshot.h +++ b/Firestore/Source/Public/FIRDocumentSnapshot.h @@ -27,6 +27,12 @@ NS_ASSUME_NONNULL_BEGIN */ typedef NS_ENUM(NSInteger, FIRServerTimestampBehavior) { /** + * Return `NSNull` for `FieldValue.serverTimestamp()` fields that have not yet + * been set to their final value. + */ + FIRServerTimestampBehaviorNone, + + /** * Return a local estimates for `FieldValue.serverTimestamp()` * fields that have not yet been set to their final value. This estimate will * likely differ from the final value and may cause these pending values to @@ -38,13 +44,7 @@ typedef NS_ENUM(NSInteger, FIRServerTimestampBehavior) { * Return the previous value for `FieldValue.serverTimestamp()` fields that * have not yet been set to their final value. */ - FIRServerTimestampBehaviorPrevious, - - /** - * Return `NSNull` for `FieldValue.serverTimestamp()` fields that have not yet - * been set to their final value. - */ - FIRServerTimestampBehaviorNone + FIRServerTimestampBehaviorPrevious }; /** |