Skip to content

[in_app_purchase_storekit] Group purchases into a single event in storekit2 - #12237

Merged
auto-submit[bot] merged 8 commits into
flutter:mainfrom
Hari-07:storekit2-restore-purchases
Aug 12, 2026
Merged

[in_app_purchase_storekit] Group purchases into a single event in storekit2#12237
auto-submit[bot] merged 8 commits into
flutter:mainfrom
Hari-07:storekit2-restore-purchases

Conversation

@Hari-07

@Hari-07 Hari-07 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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

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-assist bot 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

  1. 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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@Hari-07
Hari-07 requested a review from LouiseHsu July 18, 2026 11:56
@stuartmorgan-g stuartmorgan-g added the triage-ios Should be looked at in iOS triage label Aug 11, 2026
@@ -303,7 +304,9 @@ extension InAppPurchasePlugin: InAppPurchase2API {
message:
"This purchase could not be restored.",
details: unverifiedPurchases)))
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that makes sense, will update

@LouiseHsu LouiseHsu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!😊

@LouiseHsu LouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 12, 2026
@auto-submit
auto-submit Bot merged commit 94485f1 into flutter:main Aug 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: in_app_purchase platform-ios platform-macos triage-ios Should be looked at in iOS triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[in_app_purchase_storekit] Storekit2 RestorePurchase should give a single event.

3 participants