Skip to content
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

[CSDK-302] Fix: attempt to reconnect when billing response is error #558

Merged
merged 3 commits into from
Jul 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
added a few cases where we retry connection
  • Loading branch information
aboedo committed Jul 11, 2022
commit ee16cbb7657d0dbd1e6046ce2cf060c8ed1609ef
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,19 @@ class BillingWrapper(
}
}
}
BillingClient.BillingResponseCode.SERVICE_DISCONNECTED,
BillingClient.BillingResponseCode.USER_CANCELED,
BillingClient.BillingResponseCode.SERVICE_TIMEOUT,
BillingClient.BillingResponseCode.ERROR,
BillingClient.BillingResponseCode.SERVICE_UNAVAILABLE,
BillingClient.BillingResponseCode.USER_CANCELED,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm should we retry on a USER_CANCELED response code? Though I guess we shouldn't get this code in the onBillingSetupFinished callback and this is just to complete the cases, seems like it could be part of the codes where we don't retry? Just would like to understand why it was put here.

BillingClient.BillingResponseCode.SERVICE_DISCONNECTED -> {
log(
LogIntent.GOOGLE_WARNING, BillingStrings.BILLING_CLIENT_ERROR
.format(billingResult.toHumanReadableDescription())
)
retryBillingServiceConnectionWithExponentialBackoff()
}
BillingClient.BillingResponseCode.ITEM_UNAVAILABLE,
BillingClient.BillingResponseCode.ERROR,
BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED,
BillingClient.BillingResponseCode.SERVICE_TIMEOUT,
BillingClient.BillingResponseCode.ITEM_NOT_OWNED -> {
log(
LogIntent.GOOGLE_WARNING, BillingStrings.BILLING_CLIENT_ERROR
Expand Down