Skip to content

ReceiptParser: ensure parsing never happens in the main thread#2123

Merged
NachoSoto merged 4 commits into
mainfrom
integration-tests-receipt-decoding-main-thread
Dec 13, 2022
Merged

ReceiptParser: ensure parsing never happens in the main thread#2123
NachoSoto merged 4 commits into
mainfrom
integration-tests-receipt-decoding-main-thread

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

Fixes #2107 and SDKONCALL-180.

This comment pointed out that parsing a long receipt can freeze the UI for almost a second.

⚠️ This new assertion (running only in integration tests using the code added in #2100) has exposed a couple of code paths where we parse receipts from the main thread!

@NachoSoto NachoSoto requested a review from a team December 9, 2022 01:07
@NachoSoto NachoSoto removed the WIP label Dec 9, 2022
@NachoSoto NachoSoto marked this pull request as ready for review December 9, 2022 01:13
@NachoSoto NachoSoto merged commit 903d3b3 into main Dec 13, 2022
@NachoSoto NachoSoto deleted the integration-tests-receipt-decoding-main-thread branch December 13, 2022 16:24
NachoSoto pushed a commit that referenced this pull request Dec 14, 2022
**This is an automatic release.**

### Bugfixes
* Un-deprecate `Purchases.configure(withAPIKey:appUserID:)` and
`Purchases.configure(withAPIKey:appUserID:observerMode:)` (#2129) via
NachoSoto (@NachoSoto)
### Other Changes
* `ReceiptFetcherTests`: refactored tests using `waitUntilValue` (#2144)
via NachoSoto (@NachoSoto)
* Added a few performance improvements for `ReceiptParser` (#2124) via
NachoSoto (@NachoSoto)
* `CallbackCache`: fixed reference (#2143) via NachoSoto (@NachoSoto)
* `PostReceiptDataOperation`: clarified receipt debug log (#2128) via
NachoSoto (@NachoSoto)
* `CallbackCache`: avoid exposing internal mutable cache (#2136) via
NachoSoto (@NachoSoto)
* `CallbackCache`: added assertion for tests to ensure we don't leak
callbacks (#2137) via NachoSoto (@NachoSoto)
* `NetworkOperation`: made `Atomic` references immutable (#2139) via
NachoSoto (@NachoSoto)
* `ReceiptParser`: ensure parsing never happens in the main thread
(#2123) via NachoSoto (@NachoSoto)
* `PostReceiptDataOperation`: also print receipt data with `verbose`
logs (#2127) via NachoSoto (@NachoSoto)
* `BasePurchasesTests`: detecting and fixing many `DeviceCache` leaks
(#2105) via NachoSoto (@NachoSoto)
* `StoreKitIntegrationTests`: added test to check applying a promotional
offer during subscription (#1588) via NachoSoto (@NachoSoto)
NachoSoto added a commit that referenced this pull request Jul 31, 2023
Follow-up to #2860.
Thanks to integration tests for catching this (#2123).
@vegaro vegaro added pr:other and removed pr:perf labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Processing under the main thread hangs the UI

3 participants