Skip to content

[in_app_purchase_storekit] Fixes manual invocation of finishTransaction() triggering fatal crash - #8071

Merged
auto-submit[bot] merged 14 commits into
flutter:mainfrom
LouiseHsu:fix-finish-transaction-crash
Nov 13, 2024
Merged

[in_app_purchase_storekit] Fixes manual invocation of finishTransaction() triggering fatal crash#8071
auto-submit[bot] merged 14 commits into
flutter:mainfrom
LouiseHsu:fix-finish-transaction-crash

Conversation

@LouiseHsu

@LouiseHsuLouiseHsu commented Nov 12, 2024

Copy link
Copy Markdown
Contributor

Fixesflutter/flutter#154763

From the Apple docs:
https://developer.apple.com/documentation/storekit/skpaymentqueue/1506003-finishtransaction
If you call finishTransaction(_:) on a transaction that is in the [SKPaymentTransactionState.purchasing](https://developer.apple.com/documentation/storekit/skpaymenttransactionstate/purchasing) state, StoreKit raises an exception.

For some reason even though the old Obj-C implementation didn't have this check, it didn't crash. This adds an explicit check for the purchasing state.

Pre-launch Checklist

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

@LouiseHsuLouiseHsu changed the title wip finish transaction bug [in_app_purchase_storekit] Fixes manual invocation of finishTransaction() triggering fatal crashNov 12, 2024
@LouiseHsu
LouiseHsu marked this pull request as ready for review November 12, 2024 23:12
@LouiseHsuLouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 13, 2024
@auto-submit
auto-submitBot merged commit b9ac917 into flutter:mainNov 13, 2024
@auto-submitauto-submitBot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 14, 2024
auto-submitBot pushed a commit to flutter/flutter that referenced this pull request Nov 14, 2024
flutter/packages@26e123a...b9ac917
2024-11-13 louisehsu@google.com [in_app_purchase_storekit] Fixes manual invocation of `finishTransaction()` triggering fatal crash (flutter/packages#8071)
2024-11-13 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.8.2 to 1.9.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#7988)
2024-11-13 louisehsu@google.com [in_app_purchase_storekit] Remove unneeded platform annotations (flutter/packages#7914)
2024-11-13 stuartmorgan@google.com [tool] Improve Swift lint error message (flutter/packages#8074)
2024-11-13 engine-flutter-autoroll@skia.org Roll Flutter from c8510f2 to ed553d1 (48 revisions) (flutter/packages#8076)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…ion()` triggering fatal crash (flutter#8071)
Fixesflutter/flutter#154763
From the Apple docs: https://developer.apple.com/documentation/storekit/skpaymentqueue/1506003-finishtransaction
`If you call finishTransaction(_:) on a transaction that is in the [SKPaymentTransactionState.purchasing](https://developer.apple.com/documentation/storekit/skpaymenttransactionstate/purchasing) state, StoreKit raises an exception.`
For some reason even though the old Obj-C implementation didn't have this check, it didn't crash. This adds an explicit check for the purchasing state.
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…ion()` triggering fatal crash (flutter#8071)
Fixesflutter/flutter#154763
From the Apple docs: https://developer.apple.com/documentation/storekit/skpaymentqueue/1506003-finishtransaction
`If you call finishTransaction(_:) on a transaction that is in the [SKPaymentTransactionState.purchasing](https://developer.apple.com/documentation/storekit/skpaymenttransactionstate/purchasing) state, StoreKit raises an exception.`
For some reason even though the old Obj-C implementation didn't have this check, it didn't crash. This adds an explicit check for the purchasing state.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[in_app_purchase ][iOS] When upgrading in_app_purchase 3.1.13 to 3.2.0, a fatal crash occurs if I manually call SKPaymentQueueWrapper().finishTransaction

2 participants

@LouiseHsu@hellohuanlin