NewsResourceType
is not really an enum
and incorrectly ignores valid types
#901
-
ContextThe current news resource type is defined like this: And uses this manual deserializing method instead of regular KotlinX Serialization: Issues
SolutionWhat I would propose is to remove this enum data type, as it is only used as a display value. WDYT? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Thanks for the suggestion Simon! When initially designed it was intended to be an enum, though as you pointed out as the app evolved the enum is no longer strict. We'll discuss internally if we want to coerce the violating types into the established enums, or loosen the type as you've done. Your assertion:
Is also correct as the changelist will not be updated after an app update, and so the app will only ever see "Unknown". |
Beta Was this translation helpful? Give feedback.
-
Yes, great point. In the original spec we had the type as an enum so that the news resources could easily be filtered by type:
These features haven't been implemented, and given that it's relatively trivial to add this back in, it makes sense to change to the simpler
Thankfully there aren't any news resources with these types. The type strings currently in use are: Article 📚 Note the addition of emojis in all of these except "Codelab". We should use the emojis in the test data as well. I'll add a comment in the PR. |
Beta Was this translation helpful? Give feedback.
-
Resolved in #902 |
Beta Was this translation helpful? Give feedback.
Resolved in #902