diff options
author | Benoit St-Pierre <ben@benoitstpierre.com> | 2018-01-15 10:47:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 10:47:40 -0500 |
commit | 722b83c2363af5ccd9f8d9b76760ffad7a4470c9 (patch) | |
tree | cd8b49e76242711065f4493b8122e46729a6f7b1 | |
parent | 8a44abbf4fa34868e9ade2046d6c2c100441dc10 (diff) | |
parent | f2f0da7644a0ab2a2ff32def70c196f235d81606 (diff) |
Merge pull request #667 from firebase/bs-cherrypick
Fix issue @morganchen12 discovered where we weren't properly creating FIRQueryDocumentSnapshot instances. (#662)
-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 |