Skip to content

[in_app_purchase_storekit] Preserve zero-valued StoreKit 2 transaction IDs - #13709

Draft
ke7in-zz wants to merge 1 commit into
flutter:mainfrom
ke7in-zz:fix/storekit2-zero-transaction-id
Draft

ke7in-zz wants to merge 1 commit into
flutter:mainfrom
ke7in-zz:fix/storekit2-zero-transaction-id

Conversation

@ke7in-zz

Copy link
Copy Markdown

StoreKit 2 uses transaction ID 0 for pending and cancelled messages that have no transaction, but StoreKit testing can also produce a real transaction with ID 0. The id > 0 check drops both purchaseID and sk2Transaction for that purchase, and completePurchase then throws on the null ID.

Determine transaction presence from the purchased/restored status instead, preserving the native ID. Pending and cancelled messages retain null metadata. No Pigeon or native API changes are needed.

Fixes flutter/flutter#188276.

Validation

  • The new public-platform regression fails with the old gates (purchaseID is null) and passes with this change.
  • The release-0.4.17-compatible backport passed all 111 package tests, library/test analysis and formatting on Flutter 3.41.2. Local dependency resolution used a temporary override of the unused Pigeon dev tool; no code generation was run and the override is not committed.
  • Exact-main CI is pending; main now requires Flutter 3.44/Dart 3.12. The fake host's finish is a no-op, so the unit test does not establish native transaction completion.

AI-assisted draft; human contributor review and CLA confirmation are pending.

Pre-Review Checklist

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

@google-cla

google-cla Bot commented Nov 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[in_app_purchase_storekit]: StoreKit 2 id 0 is converted to null, causing completePurchase to throw and leaves the transaction unfinished

1 participant