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
fix(cloud_firestore_odm): add support for searching Enums #8386
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
Hello! Could you add tests for this? Thanks 😄 |
@rrousselGit I will try and add a test next week if you would like. I wasn't sure if you wanted to review it first. (I'm out of town at the moment, sorry I can't do it sooner). |
Hey @mrorabau. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
@google-oss-bot I'm working on the tests (as requested). Having some issues. |
@rrousselGit If you could take a look at this and see what else is needed. I tried to use the same type of tests you had, however it seems that it only tests for expected compile errors. |
@Salakar |
Hey @mrorabau, I'm not sure what is happening but you've reformatted the entirety of the iOS code base 🤔. Do you mind updating to the latest |
@rrousselGit |
@rrousselGit
|
@rrousselGit |
Hello! |
I don't have the permission to push to your PR. Could you fix the conflicts? |
Hi Remi,
I've de-conflicted it. So please take a look. BTW, your updates I think
will help a lot. I had started a fix for timestamps/datetime but it looks
like you already got to that.
…-mark
On Tue, Jul 12, 2022 at 3:38 AM Remi Rousselet ***@***.***> wrote:
I don't have the permission to push to your PR. Could you fix the
conflicts?
—
Reply to this email directly, view it on GitHub
<#8386 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANWRA5HLNKE3DRJM7LUWITVTUOGTANCNFSM5SMIEBKA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@@ -413,6 +414,7 @@ extension on DartType { | |||
generic.isDartCoreString || | |||
generic.isDartCoreBool || | |||
generic.isDartCoreObject || | |||
generic.element?.kind == ElementKind.ENUM || |
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.
I don't see a test for List<MyEnum>
. Could you add one? 😄
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.
Remi,
First, I'm sorry for the delay, but I was trying to test the latest build against our project and it took me a while to figure out that we now seem to need a build.yaml in our own project in order to set the create_field_map=true. Otherwise it produces a bunch of errors. I didn't (currently) see this in the docs. I think if this is a requirement going forward it really needs to by highlighted.
I also changed "dart pub get" to "flutter pub get" in melos.yaml/odm:generator_test_build_runner:build (It was giving me a lot of headaches)
I added List to the Nested collection. Is that sufficient for the List test?
Thanks for your support!
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.
Thanks for your effort!
About create_field_map, it should be optional. Maybe there's something I missed. I'll look into it
About your test, could you maybe move it to example/test_driver & add a test that performs a query?
Such as collection.whereMyEnum(isEqualTo: MyEnum.value)
& maybe one for List too (although I think we're lacking arrayContains
query for that.
There should be a few tests there that already do that which you could copy-paste
The goal would be to test that the generated work actually works, instead of simply compiling.
… pr/mrorabau/8386
It sounds like we'll have to wait for Flutter to be compatible with analyzer 5.2.0 (which json_serializable uses). |
It sounds like Flutter is now compatible with analyzer 5.2.0, so I'll resume fixing this :) |
Seems like I got confused. |
@rrousselGit can you elaborate on this? I think you are saying the fix/compatability in the latest flutter isn't actually working on wasn't combined to master/stable? |
@rrousselGit is Flutter/analyser v5.2+ compatibility issue solved with Flutter 3.7 ? |
# Conflicts: # .github/workflows/firebase_firestore.yaml # .github/workflows/firebase_performance.yaml # melos.yaml # packages/cloud_firestore_odm/cloud_firestore_odm/example/pubspec.yaml # packages/cloud_firestore_odm/cloud_firestore_odm_generator/lib/src/collection_data.dart # packages/cloud_firestore_odm/cloud_firestore_odm_generator/pubspec.yaml # packages/cloud_firestore_odm/cloud_firestore_odm_generator/pubspec_overrides.yaml
Closing this PR, since the ODM is now hosted in its own repository: https://github.com/firebaseextended/firestoreodm-flutter |
Description
This PR should add support for searching Enums [.whereMyEnum()]. Previously using an Enum in a model would be stored and retrieved, but then it couldn't be searched on.
Related Issues
Closes #8338
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?