plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[in_app_purchase_android] Implement `BillingClient` connection management and introduce `BillingClientManager`

Open SynSzakala opened this issue 2 years ago • 2 comments

This PR adds management of BillingClient connection to Android implementation of InAppPurchase. This should fix issues caused by lost connections.

New and previously existing connection management is extracted to a new component, BillingClientManager. This component is exported in billing_client_wrappers.dart, so that it can also be used when interacting with BillingClient directly.

Fixes https://github.com/flutter/flutter/issues/110663

Pre-launch Checklist

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
  • [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • [x] I signed the CLA.
  • [x] The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • [x] I listed at least one issue that this PR fixes in the description above.
  • [x] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • [x] I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] I added new tests to check the change I am making, or this PR is test-exempt.
  • [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

SynSzakala avatar Aug 24 '22 16:08 SynSzakala

I look forward to this PR being merged. Thanks!!

dgjamaster avatar Sep 07 '22 00:09 dgjamaster

@GaryQian Ping on this review.

stuartmorgan avatar Sep 20 '22 15:09 stuartmorgan

@SynSzakala Overall looks good, just a few small nits. Let me know when you address them!

GaryQian avatar Oct 06 '22 20:10 GaryQian

@SynSzakala It looks like there are some CLA signing issues where your secondary email needs to accept the CLA, or you can amend the commit that used your alternate email address and force-push.

GaryQian avatar Oct 25 '22 17:10 GaryQian

@GaryQian Everything should be ready for merge now.

SynSzakala avatar Nov 02 '22 18:11 SynSzakala

Thanks for this PR! The issue with lost connections leading to refunded purchases is hitting us pretty hard in production, so this is much appreciated.

olof-dev avatar Nov 20 '22 21:11 olof-dev

@stuartmorgan @GaryQian Is there anything preventing us from merging this?

SynSzakala avatar Nov 23 '22 11:11 SynSzakala

@SynSzakala When you get a chance to fix the failing analyzer checks, we can move forwards with this. Thanks!

GaryQian avatar Jan 05 '23 19:01 GaryQian

@SynSzakala It looks like the analyzer complaints are just warnings to do with 4 unneeded awaits. I was gonna send you a PR that deletes them, but I realized that there might then be CLA-type stuff to deal with. In any case, thanks again for this PR - it's substantial!

olof-dev avatar Jan 19 '23 16:01 olof-dev

@GaryQian @stuartmorgan Cleared all comments (including unnecessary refactors), fixed analyzer issues. Looking forward to merge this!

SynSzakala avatar Feb 03 '23 11:02 SynSzakala

@stuartmorgan @GaryQian Are there any additional steps needed to merge this? I don't have the access to add "autosubmit" label as suggested in Tree Hygiene

SynSzakala avatar Feb 08 '23 10:02 SynSzakala

Are there any additional steps needed to merge this?

This needs a second review, per https://github.com/flutter/flutter/wiki/Tree-hygiene#getting-a-code-review

@bparrishMines Could you do the second review here, as the ecosystem-side codeowner for this plugin?

stuartmorgan avatar Feb 10 '23 16:02 stuartmorgan

We've just completed the migration of the plugin code to the flutter/packages repository, as described in https://flutter.dev/go/flutter-plugins-repo-migration, and this repository is now being archived. Unfortunately that means that all in-progress PRs here must be moved to flutter/packages.

Please see our instructions for an explanation of how to move your PR, and if you have any issues moving your PR please don't hesitate to reach out in the #hackers-ecosystem channel in Discord.

Our apologies that your PR was caught in this one-time transition. We're aware that it's disruptive in the short term, and appreciate your help in getting us to a better long-term state!

stuartmorgan avatar Feb 22 '23 15:02 stuartmorgan