AAAttribution.attributionToken: avoid using on main thread#3281
Merged
Conversation
479866f to
83cc0f9
Compare
83cc0f9 to
93d01b9
Compare
12 tasks
aboedo
approved these changes
Oct 5, 2023
Member
|
CI is angry, we might be missing some availability checks. Thanks for taking care of this! |
Contributor
Author
|
Yeah thanks! I still don't know why I can't reproduce those errors locally (requiring iOS 13 for any concurrency API). |
1001da4 to
8c99095
Compare
8c99095 to
c15ac21
Compare
This was referenced Oct 6, 2023
NachoSoto
pushed a commit
that referenced
this pull request
Oct 6, 2023
**This is an automatic release.** ### RevenueCatUI * `Paywalls`: improved purchase-in-progress UI (#3279) via NachoSoto (@NachoSoto) ### Bugfixes * `SK2StoreProduct.priceFormatter`: use locale from `StoreKit.Product` (#3278) via NachoSoto (@NachoSoto) ### Performance Improvements * `AAAttribution.attributionToken`: avoid using on main thread (#3281) via NachoSoto (@NachoSoto) ### Other Changes * `Paywalls Tester`: group live paywalls by template (#3276) via NachoSoto (@NachoSoto)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3281 +/- ##
==========================================
+ Coverage 85.82% 85.85% +0.03%
==========================================
Files 236 236
Lines 16790 16822 +32
==========================================
+ Hits 14410 14443 +33
+ Misses 2380 2379 -1 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3280.
Turns out that
AAAttribution.attributionToken()is asynchronous, and Apple will happily allow you to make a blocking network request on the main thread. This avoids that.I've refactored
AttributionFetcher.adServicesTokento beasyncand addedRCTestAssertNotMainThreadto ensure this doesn't break again.The rest of the changes were necessary to accommodate the new
asyncAPI.