[in_app_purchase_storekit] Group purchases into a single event in storekit2 - #12237
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the StoreKit 2 implementation to batch restored transactions into a single update callback instead of sending them individually. It aggregates verified transactions into an array and dispatches them together using a new sendTransactionUpdates helper method. Additionally, a unit test has been added to verify that restoring multiple products emits a single batched update. There are no review comments, and I have no feedback to provide.
| @@ -303,7 +304,9 @@ extension InAppPurchasePlugin: InAppPurchase2API { | |||
| message: | |||
| "This purchase could not be restored.", | |||
| details: unverifiedPurchases))) | |||
| return | |||
There was a problem hiding this comment.
as far as i can tell, this means that if theres even one unverified transaction, the entire batch of transactions will not be dispatched. is this the behaviour you expect? I would imagine you would want to at least dispatch the verified transactions that have already been iterated over
There was a problem hiding this comment.
Yeah that makes sense, will update
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue.
Fixes flutter/flutter#187355
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2