Skip to content

Performance: new check to ensure serialization / deserialization is done from background thread#2496

Merged
NachoSoto merged 1 commit into
mainfrom
nacho/sdk-3104-decode-customerinfo-in-a-background
May 19, 2023
Merged

Performance: new check to ensure serialization / deserialization is done from background thread#2496
NachoSoto merged 1 commit into
mainfrom
nacho/sdk-3104-decode-customerinfo-in-a-background

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

No description provided.

@NachoSoto NachoSoto added the perf label May 16, 2023
@NachoSoto NachoSoto requested a review from a team May 16, 2023 14:30
@NachoSoto NachoSoto force-pushed the nacho/sdk-3104-decode-customerinfo-in-a-background branch 4 times, most recently from 92e19f8 to b2dab3b Compare May 16, 2023 18:29
@codecov

codecov Bot commented May 16, 2023

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.82%. Comparing base (e9e6d88) to head (6a99558).
Report is 1133 commits behind head on main.

Files with missing lines Patch % Lines
...urces/Networking/Operations/NetworkOperation.swift 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2496      +/-   ##
==========================================
+ Coverage   87.80%   87.82%   +0.02%     
==========================================
  Files         198      199       +1     
  Lines       13616    13631      +15     
==========================================
+ Hits        11955    11971      +16     
+ Misses       1661     1660       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NachoSoto NachoSoto marked this pull request as ready for review May 16, 2023 18:47
@NachoSoto

Copy link
Copy Markdown
Contributor Author

Cross-posting from Linear:

Looks like the only time we decode CustomerInfo in the main thread is when we initialize the SDK and we load it from cache. We could change that, but it would slightly change the behavior since we wouldn't be sending the first CustomerInfo to the delegate until after the next iteration of the run loop, which might potentially be breaking for some apps.

@aboedo thoughts on leaving that behavior?

@NachoSoto NachoSoto force-pushed the nacho/sdk-3104-decode-customerinfo-in-a-background branch from b2dab3b to ae94851 Compare May 19, 2023 17:35
@NachoSoto

Copy link
Copy Markdown
Contributor Author

Merging this for now. We can talk about the decoding change on Linear.

@NachoSoto NachoSoto enabled auto-merge (squash) May 19, 2023 17:37
@NachoSoto NachoSoto force-pushed the nacho/sdk-3104-decode-customerinfo-in-a-background branch from ae94851 to 6a99558 Compare May 19, 2023 18:15
@NachoSoto NachoSoto merged commit 50ffbfb into main May 19, 2023
@NachoSoto NachoSoto deleted the nacho/sdk-3104-decode-customerinfo-in-a-background branch May 19, 2023 18:58
This was referenced May 31, 2023
@NachoSoto NachoSoto mentioned this pull request May 31, 2023
NachoSoto added a commit that referenced this pull request Jun 1, 2023
**This is an automatic release.**

### New Features
* `Offline Entitlements`: use offline-computed `CustomerInfo` when
server is down (#2368) via NachoSoto (@NachoSoto)

### Bugfixes
* `AppleReceipt.debugDescription`: don't pretty-print JSON (#2564) via
NachoSoto (@NachoSoto)
* `SK2StoreProduct`: fix crash on iOS 12 (#2565) via NachoSoto
(@NachoSoto)
* `GetCustomerInfo` posts receipts if there are pending transactions
(#2533) via NachoSoto (@NachoSoto)
### Performance Improvements
* `PurchasedProductsFetcher`: cache current entitlements (#2507) via
NachoSoto (@NachoSoto)
* Performance: new check to ensure serialization / deserialization is
done from background thread (#2496) via NachoSoto (@NachoSoto)
### Dependency Updates
* Bump fastlane from 2.212.2 to 2.213.0 (#2544) via dependabot[bot]
(@dependabot[bot])
### Other Changes
* `CustomerInfoManager`: post all unfinished transactions (#2563) via
NachoSoto (@NachoSoto)
* `PostReceiptOperation`: added ability to also post `AdServices` token
(#2566) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: improved computation log (#2562) via NachoSoto
(@NachoSoto)
* Added `TransactionPoster` tests (#2557) via NachoSoto (@NachoSoto)
* Refactored `TransactionPoster`: removed 2 dependencies and abstracted
parameters (#2542) via NachoSoto (@NachoSoto)
* `CustomerInfoManagerTests`: wait for `getAndCacheCustomerInfo` to
finish (#2555) via NachoSoto (@NachoSoto)
* `StoreTransaction`: implemented `description` (#2556) via NachoSoto
(@NachoSoto)
* `Backend.ResponseHandler` is now `@Sendable` (#2541) via NachoSoto
(@NachoSoto)
* Extracted `TransactionPoster` from `PurchasesOrchestrator` (#2540) via
NachoSoto (@NachoSoto)
* `enableAdServicesAttributionTokenCollection`: added integration test
(#2551) via NachoSoto (@NachoSoto)
* `AttributionPoster`: replaced hardcoded strings with constants (#2548)
via NachoSoto (@NachoSoto)
* `DefaultDecodable`: moved to `Misc/Codable/DefaultDecodable.swift`
(#2528) via NachoSoto (@NachoSoto)
* `CircleCI`: specify device to run `backend_integration_tests` (#2547)
via NachoSoto (@NachoSoto)
* Created `StoreKit2TransactionFetcher` (#2539) via NachoSoto
(@NachoSoto)
* Fix load shedder integration tests (#2546) via Josh Holtz
(@joshdholtz)
* Fix doc on `Offering.getMetadataValue` (#2545) via Josh Holtz
(@joshdholtz)
* Extracted and tested `AsyncSequence.extractValues` (#2538) via
NachoSoto (@NachoSoto)
* `Offline Entitlements`: don't compute offline `CustomerInfo` when
purchasing a consumable products (#2522) via NachoSoto (@NachoSoto)
* `OfflineEntitlementsManager`: disable offline `CustomerInfo` in
observer mode (#2520) via NachoSoto (@NachoSoto)
* `BasePurchasesTests`: fixed leak detection (#2534) via NachoSoto
(@NachoSoto)
* `PurchaseTesterSwiftUI`: added `ProxyView` to `iOS` (#2531) via
NachoSoto (@NachoSoto)
* `PurchasedProductsFetcher`: removed `AppStore.sync` call (#2521) via
NachoSoto (@NachoSoto)
* `PurchaseTesterSwiftUI`: added new window on Mac to manage proxy
(#2518) via NachoSoto (@NachoSoto)
* `PurchasedProductsFetcher`: added log if fetching purchased products
is slow (#2515) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: disable for custom entitlements mode (#2509)
via NachoSoto (@NachoSoto)
* `Offline Entitlements`: fixed iOS 12 tests (#2514) via NachoSoto
(@NachoSoto)
* `PurchasedProductsFetcher`: don't throw errors if purchased products
were found (#2506) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: allow creating offline `CustomerInfo` with
empty `ProductEntitlementMapping` (#2504) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: integration tests (#2501) via NachoSoto
(@NachoSoto)
* `CustomerInfoManager`: don't cache offline `CustomerInfo` (#2378) via
NachoSoto (@NachoSoto)
* `DangerousSettings`: debug-only `forceServerErrors` (#2486) via
NachoSoto (@NachoSoto)
* `CocoapodsInstallation`: fixed `Xcode 14.3.0` issue (#2489) via
NachoSoto (@NachoSoto)
* `CarthageInstallation`: removed workaround (#2488) via NachoSoto
(@NachoSoto)

---------

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

3 participants