Skip to content

Fix issue @morganchen12 discovered where we weren't properly creating FIRQueryDocumentSnapshot instances. #663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ - (void)testQuerySnapshotEvents_forAdd {

} 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];
Expand Down
8 changes: 4 additions & 4 deletions Firestore/Source/API/FIRDocumentSnapshot.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ + (instancetype)snapshotWithFirestore:(FIRFirestore *)firestore
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
Expand Down