diff options
author | Michael Lehenbauer <mikelehen@gmail.com> | 2018-01-12 15:54:42 -0800 |
---|---|---|
committer | Benoit St-Pierre <bstpierre@google.com> | 2018-01-15 10:35:04 -0500 |
commit | f2f0da7644a0ab2a2ff32def70c196f235d81606 (patch) | |
tree | cd8b49e76242711065f4493b8122e46729a6f7b1 /Firestore | |
parent | 8a44abbf4fa34868e9ade2046d6c2c100441dc10 (diff) |
Fix issue @morganchen12 discovered where we weren't properly creating FIRQueryDocumentSnapshot instances. (#662)
Diffstat (limited to 'Firestore')
-rw-r--r-- | Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m | 1 | ||||
-rw-r--r-- | Firestore/Source/API/FIRDocumentSnapshot.m | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m b/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m index f557ee6..9a53e29 100644 --- a/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m +++ b/Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m @@ -611,6 +611,7 @@ } else if (callbacks == 2) { XCTAssertEqual(docSet.count, 1); + XCTAssertTrue([docSet.documents[0] isKindOfClass:[FIRQueryDocumentSnapshot class]]); XCTAssertEqualObjects(docSet.documents[0].data, newData); XCTAssertEqual(docSet.documents[0].metadata.hasPendingWrites, YES); [changeCompletion fulfill]; diff --git a/Firestore/Source/API/FIRDocumentSnapshot.m b/Firestore/Source/API/FIRDocumentSnapshot.m index 358ddac..80b60e6 100644 --- a/Firestore/Source/API/FIRDocumentSnapshot.m +++ b/Firestore/Source/API/FIRDocumentSnapshot.m @@ -51,10 +51,10 @@ NS_ASSUME_NONNULL_BEGIN documentKey:(FSTDocumentKey *)documentKey document:(nullable FSTDocument *)document fromCache:(BOOL)fromCache { - return [[FIRDocumentSnapshot alloc] initWithFirestore:firestore - documentKey:documentKey - document:document - fromCache:fromCache]; + return [[[self class] alloc] initWithFirestore:firestore + documentKey:documentKey + document:document + fromCache:fromCache]; } @end |