-
Notifications
You must be signed in to change notification settings - Fork 10
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: error codes mismap android #85
Conversation
@@ -23,4 +25,14 @@ internal class MappersHelpersTests { | |||
assertThat(date3?.toMillis()).isEqualTo(649382400000L) | |||
} | |||
|
|||
@Test | |||
fun `purchasesErrors are mapped correctly`() { |
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.
confirmed that this test fails on develop
message, | ||
mapOf( | ||
"code" to code.ordinal, |
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.
great find :)
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.
🔢
Addresses RevenueCat/purchases-flutter#222
We have a bug in the code that maps
PurchasesErrorCode
->ErrorContainer
->Map
.We're using
ordinal
to find the value of the error code enum, however, since there's no value for code13
, this maps the wrong error code for all errors after13
.Fixed by replacing usage of
ordinal
with.code
.