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
Support for cloud_firestore 4.4.0 #266
Conversation
#265 relevant issue |
This looks very good. And thanks for the quick fix. |
lib/src/mock_document_reference.dart
Outdated
@@ -103,7 +103,7 @@ class MockDocumentReference<T extends Object?> implements DocumentReference<T> { | |||
message: 'Some requested document was not found.', | |||
)); | |||
} | |||
return _setRawData(data); | |||
return _setRawData(Map.from(data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to new support to FieldPath on update, the Map<String, dynamic> is not gonna cut it.. Seems this needs more work.
Looks like all unit tests still pass. Awesome! One more thing you could do in this PR is modify the affected pre-existing unit tests by passing iterables. In the Firestore PR you mentioned, they used this trick in their tests: // To force the list to be an iterable
whereIn: ['Ready to Ship', 'Ordered'].map((e) => e), We could make a utility function and use it here and there: Iterable<R> toIterable<R>(List<R> list) => list.map((e) => e); The tests in question should be in:
|
@atn832 Agreed on supporting iterables. Seems there needs to be more work on supporting FieldPath on update. Not confident I'll be able to work on it quickly due to main commitments. But can do in my free time when no one else does. |
What's in this PR
Problem
Fix