-
Notifications
You must be signed in to change notification settings - Fork 120
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
[Proto migration] Use protos when creating LOIs #2529
[Proto migration] Use protos when creating LOIs #2529
Conversation
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 did a quick first pass on mobile to provide early feedback, LGTM, just a few small suggestions.
ground/src/main/java/com/google/android/ground/persistence/remote/firebase/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/persistence/remote/firebase/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
/gcbrun |
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.
A few conceptual nits, but overall great work!
ground/src/main/java/com/google/android/ground/model/geometry/Geometry.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/model/geometry/Geometry.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/persistence/remote/firebase/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
ground/src/main/java/com/google/android/ground/persistence/remote/firebase/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/google/android/ground/persistence/remote/firebase/protobuf/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/google/android/ground/persistence/remote/firebase/protobuf/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
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.
It appears the issue is that the protobuf-lite codegen doesn't behave how the original author (me) expected wrt oneofs. The generated TypeCase enum and respective "*TypeCase_" field contains the number of the set field, and the "*Type_" field contains the actual message.
I think the easiest way is to use the TypeCase enum to get the field names and values when its encountered; the enum value's in lowercase correspond to the field names, and their values correspond to the field numbers. Wdyt?
.../main/java/com/google/android/ground/persistence/remote/firebase/protobuf/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
...java/com/google/android/ground/persistence/remote/firebase/protobuf/ModelToProtoExtKtTest.kt
Outdated
Show resolved
Hide resolved
#2537 adds support for oneofs in proto->Firestore conversion. |
@sufyanAbbasi Could you please take a look at this one too? |
...a/com/google/android/ground/persistence/remote/firebase/protobuf/LoiMutationConverterTest.kt
Outdated
Show resolved
Hide resolved
...a/com/google/android/ground/persistence/remote/firebase/protobuf/LoiMutationConverterTest.kt
Outdated
Show resolved
Hide resolved
...a/com/google/android/ground/persistence/remote/firebase/protobuf/LoiMutationConverterTest.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/google/android/ground/persistence/remote/firebase/protobuf/ModelToProtoExt.kt
Outdated
Show resolved
Hide resolved
Nicely done! |
Fixes #2499
Fixes #2541
@sufyanAbbasi @gino-m PTAL?