Skip to content

StoreKit2TransactionListener: converted into an actor#2909

Merged
NachoSoto merged 1 commit into
mainfrom
sk2-transaction-listener-actor
Aug 7, 2023
Merged

StoreKit2TransactionListener: converted into an actor#2909
NachoSoto merged 1 commit into
mainfrom
sk2-transaction-listener-actor

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

This is a preparatory refactor for an upcoming fix.
This improves the thread-safety of this class, and also refactors its mock to use a protocol instead.

@NachoSoto NachoSoto requested review from a team and aboedo July 27, 2023 14:15
@NachoSoto NachoSoto force-pushed the sk2-transaction-listener-actor branch from 99e9f50 to 1bece43 Compare July 27, 2023 14:15
@NachoSoto NachoSoto changed the base branch from main to observer-mode-integration-tests July 27, 2023 14:15
@NachoSoto NachoSoto force-pushed the sk2-transaction-listener-actor branch from 1bece43 to 981f82d Compare July 27, 2023 14:26
@NachoSoto NachoSoto force-pushed the observer-mode-integration-tests branch from 8d339a0 to cf8568e Compare July 27, 2023 14:31
@NachoSoto NachoSoto force-pushed the sk2-transaction-listener-actor branch from 981f82d to 5248e38 Compare July 27, 2023 14:33
@codecov

codecov Bot commented Jul 27, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2909 (5248e38) into main (cad8328) will decrease coverage by 0.03%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head 5248e38 differs from pull request most recent head 5b939e4. Consider uploading reports for the commit 5b939e4 to get more accurate results

@@            Coverage Diff             @@
##             main    #2909      +/-   ##
==========================================
- Coverage   86.63%   86.61%   -0.03%     
==========================================
  Files         217      217              
  Lines       15531    15521      -10     
==========================================
- Hits        13456    13443      -13     
- Misses       2075     2078       +3     
Files Changed Coverage Δ
...s/Purchasing/Purchases/PurchasesOrchestrator.swift 87.45% <100.00%> (+0.01%) ⬆️
...asing/StoreKit2/StoreKit2TransactionListener.swift 92.85% <100.00%> (+0.31%) ⬆️

... and 4 files with indirect coverage changes

@NachoSoto

Copy link
Copy Markdown
Contributor Author

Note that this depends on #2905 so can't merge it yet.

@NachoSoto NachoSoto force-pushed the observer-mode-integration-tests branch from 61913d7 to 8dc55fc Compare August 7, 2023 22:28
Base automatically changed from observer-mode-integration-tests to main August 7, 2023 22:42
This is a preparatory refactor for an upcoming fix.
This improves the thread-safety of this class, and also refactors its mock to use a `protocol` instead.
@NachoSoto NachoSoto force-pushed the sk2-transaction-listener-actor branch from 5248e38 to 5b939e4 Compare August 7, 2023 22:50
@NachoSoto NachoSoto enabled auto-merge (squash) August 7, 2023 22:52
@NachoSoto NachoSoto merged commit 069f3c0 into main Aug 7, 2023
@NachoSoto NachoSoto deleted the sk2-transaction-listener-actor branch August 7, 2023 23:10
NachoSoto added a commit that referenced this pull request Aug 9, 2023
_This release is compatible with Xcode 15 beta 6 and visionOS beta 3_

### Bugfixes
* `visionOS`: support for `Xcode 15 beta 6` (#2989) via NachoSoto
(@NachoSoto)
* `CachingProductsManager`: avoid crash when caching different products
with same identifier (#2979) via NachoSoto (@NachoSoto)
* `PurchasesOrchestrator`: disambiguate transactions from the queue
(#2890) via NachoSoto (@NachoSoto)
### Performance Improvements
* `StoreKit2TransactionListener`: handle transactions asynchronously
(#2910) via NachoSoto (@NachoSoto)
### Other Changes
* `Atomic`: avoid race conditions modifying dictionaries (#2981) via
NachoSoto (@NachoSoto)
* `Logging`: avoid logging "updating offerings" when request is cached
(#2904) via NachoSoto (@NachoSoto)
* `StoreKit2TransactionListener`: converted into an `actor` (#2909) via
NachoSoto (@NachoSoto)
* `Integration Tests`: added more observer mode tests (#2905) via
NachoSoto (@NachoSoto)
* Created `PostedTransactionCache` (#2911) via NachoSoto (@NachoSoto)
* `IntroEligibility`: changed products to `Set<String>` (#2976) via
NachoSoto (@NachoSoto)
* `AdServices`: Rename `postAdServicesTokenIfNeeded()` to
`postAdServicesTokenOncePerInstallIfNeeded()` (#2968) via Josh Holtz
(@joshdholtz)
* `SK1StoreProduct`: changed `productType` warning to debug (#2957) via
NachoSoto (@NachoSoto)
* `PrivacyInfo.xcprivacy`: added `UserDefaults` to access API types
(#2913) via NachoSoto (@NachoSoto)
* `Integration Tests`: new test to verify that SK1 purchases don't leave
SK2 unfinished transactions (#2906) via NachoSoto (@NachoSoto)
* `Logging`: log entire cache key with verbose logs (#2888) via
NachoSoto (@NachoSoto)
* `StoreProduct`: added test covering warning log (#2897) via NachoSoto
(@NachoSoto)
* `CustomEntitlementComputation`: use custom API key (#2879) via Toni
Rico (@tonidero)
* `CachingProductsManager`: removed duplicate log and added tests
(#2898) via NachoSoto (@NachoSoto)
* `Xcode 15 beta 5`: fixed test compilation (#2885) via NachoSoto
(@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
MarkVillacampa pushed a commit that referenced this pull request Sep 6, 2023
This is a preparatory refactor for an upcoming fix.
This improves the thread-safety of this class, and also refactors its
mock to use a `protocol` instead.
MarkVillacampa pushed a commit that referenced this pull request Sep 6, 2023
_This release is compatible with Xcode 15 beta 6 and visionOS beta 3_

### Bugfixes
* `visionOS`: support for `Xcode 15 beta 6` (#2989) via NachoSoto
(@NachoSoto)
* `CachingProductsManager`: avoid crash when caching different products
with same identifier (#2979) via NachoSoto (@NachoSoto)
* `PurchasesOrchestrator`: disambiguate transactions from the queue
(#2890) via NachoSoto (@NachoSoto)
### Performance Improvements
* `StoreKit2TransactionListener`: handle transactions asynchronously
(#2910) via NachoSoto (@NachoSoto)
### Other Changes
* `Atomic`: avoid race conditions modifying dictionaries (#2981) via
NachoSoto (@NachoSoto)
* `Logging`: avoid logging "updating offerings" when request is cached
(#2904) via NachoSoto (@NachoSoto)
* `StoreKit2TransactionListener`: converted into an `actor` (#2909) via
NachoSoto (@NachoSoto)
* `Integration Tests`: added more observer mode tests (#2905) via
NachoSoto (@NachoSoto)
* Created `PostedTransactionCache` (#2911) via NachoSoto (@NachoSoto)
* `IntroEligibility`: changed products to `Set<String>` (#2976) via
NachoSoto (@NachoSoto)
* `AdServices`: Rename `postAdServicesTokenIfNeeded()` to
`postAdServicesTokenOncePerInstallIfNeeded()` (#2968) via Josh Holtz
(@joshdholtz)
* `SK1StoreProduct`: changed `productType` warning to debug (#2957) via
NachoSoto (@NachoSoto)
* `PrivacyInfo.xcprivacy`: added `UserDefaults` to access API types
(#2913) via NachoSoto (@NachoSoto)
* `Integration Tests`: new test to verify that SK1 purchases don't leave
SK2 unfinished transactions (#2906) via NachoSoto (@NachoSoto)
* `Logging`: log entire cache key with verbose logs (#2888) via
NachoSoto (@NachoSoto)
* `StoreProduct`: added test covering warning log (#2897) via NachoSoto
(@NachoSoto)
* `CustomEntitlementComputation`: use custom API key (#2879) via Toni
Rico (@tonidero)
* `CachingProductsManager`: removed duplicate log and added tests
(#2898) via NachoSoto (@NachoSoto)
* `Xcode 15 beta 5`: fixed test compilation (#2885) via NachoSoto
(@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
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.

2 participants