Conditional visibility -- app version condition#2894
Conditional visibility -- app version condition#2894JZDesign wants to merge 5 commits intojzdesign/conditional-visibility-2from
Conversation
Generated by 🚫 Danger |
tonidero
left a comment
There was a problem hiding this comment.
Looking good but I do think we need to fix the semver number parsing/comparison
| * */ | ||
| @Serializable | ||
| data class AppVersion( | ||
| @SerialName("operator") val operator: ComparisonOperatorType, |
There was a problem hiding this comment.
Should we add in or not_in operators as well? Alternatively, we could add and and or... but maybe in/not_in would be enough.
|
|
||
| /** | ||
| * Serializer that converts version strings like "3.2.0" to integers like 320 by keeping only digits. | ||
| * Also handles integer inputs directly for backward compatibility. |
There was a problem hiding this comment.
Hmm does this work for comparison purposes? For example, 11.2.0 would get translated to 1120, and 2.11.0 would get translated to 2110, and it would say that the second is bigger than the first? I think we need proper semver parsing and comparison instead of parsing to an int.
There was a problem hiding this comment.
Man… you're right. Thank you for the sanity check here.
There was a problem hiding this comment.
Would be good to add some tests for this as well. Using parameterized tests we can cover a lot of cases easily.
Checklist
purchases-iosand hybridsMotivation
As we evolve the conditional visibility feature and add new conditions, our users will likely wind up in a spot where their paywalls don't render in an expected way. We need to provide an option to allow them to account for old SDKs and to control how their paywall renders if they use newer conditions that old SDKs are unaware of.
Description
Adds the ability for users to create a condition that will only show the component for a given app version