Skip to content

Conversation

@LouiseHsu
Copy link
Contributor

@LouiseHsu LouiseHsu commented Nov 12, 2024

Fixes flutter/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.

@LouiseHsu LouiseHsu changed the title wip finish transaction bug [in_app_purchase_storekit] Fixes manual invocation of finishTransaction() triggering fatal crash Nov 12, 2024
@LouiseHsu LouiseHsu marked this pull request as ready for review November 12, 2024 23:12
@LouiseHsu LouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 13, 2024
@auto-submit auto-submit bot merged commit b9ac917 into flutter:main Nov 13, 2024
77 checks passed
@auto-submit auto-submit bot 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-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 14, 2024
flutter/packages@26e123a...b9ac917

2024-11-13 [email protected] [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 [email protected] [in_app_purchase_storekit] Remove unneeded platform annotations  (flutter/packages#7914)
2024-11-13 [email protected] [tool] Improve Swift lint error message (flutter/packages#8074)
2024-11-13 [email protected] 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 [email protected] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants