-
Notifications
You must be signed in to change notification settings - Fork 50
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 OfferingsParser exceptions being swallowed #1228
Conversation
475a5de
to
8bc250d
Compare
offeringParser = offeringParser | ||
billing, | ||
offeringParser, | ||
dispatcher | ||
) | ||
} |
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 am not entirely sure what else to test here. The issue was due to billing.queryProductDetailsAsync(
returning in a different thread, but we can't really test that 🤔
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## paywalls #1228 +/- ##
===========================================
Coverage ? 85.12%
===========================================
Files ? 187
Lines ? 6345
Branches ? 923
===========================================
Hits ? 5401
Misses ? 597
Partials ? 347 ☔ View full report in Codecov by Sentry. |
.groupBy { subProduct -> subProduct.purchasingData.productId } | ||
.toMutableMap() | ||
val subscriptionIds = productsById.keys | ||
dispatcher.enqueue(command = { |
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'm wondering if we should do this inside the BillingWrapper.queryProductDetailsAsync
so it fixes possible problems in other places that call it... But I'm ok doing this for now and rethinking it later.
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.
That's true... But that might involve more testing since it might break other parts of the code. I think I am ok with doing this for now, then fixing all calls in BillingWrapper to return in our own threads
Nice! A couple questions:
|
Probably yes, but it would be tricky, since this happens when a crash happens in Google's Billing client thread. I think we should be able to reproduce with a normal background thread though so it should be doable.
Yes, though since we only found about this issue due to crashes while parsing the offerings response, and the chance that this may be a risky change, we decided to keep it isolated to this area for now. I added a ticket to track it and do it for the whole app though |
This should be fixed in other places too, but for now, I am just fixing it in OfferingsParser