* [Diagnostics] Add apple_products_request event
* Fixes from review
* Change tests to use to(beNil())
* Make MockDiagnosticsTracker sendable to fix tests
* Add new property to track storekit error type
* Use new method to process sk errors
### Description
This moves the offline backend integration tests to run on M1 machines
in CircleCI.
Since this causes tests to be much more flaky, this includes a
cherry-pick of the changes in the 5.0 branch that improves those:
https://github.com/RevenueCat/purchases-ios/pull/3902
---------
Co-authored-by: Josh Holtz <me@joshholtz.com>
Co-authored-by: Will Taylor <wtaylor151@gmail.com>
Co-authored-by: Andy Boedo <andresboedo@gmail.com>
The existing implementation was posting them in sequence, which meant
that it was always going to make N requests.
With this new implementation we can ensure that only one request is made
for all transactions.
Currently when launching an app in SK1 mode, if there are multiple
transactions in the queue, we handle them all and begin operations in
parallel. If the cache keys are the same, those end up being a combined
POST receipt request.
However with `StoreKit 2`, because we were waiting to handle each one of
the `StoreKit.Transaction.updates` using `await`, we ended up posting
them all sequentially, instead of relying on `CallbackCache`.
This also adds a lot more coverage for `StoreKit2TransactionListener` to
verify this behavior.
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.
This extracts the logic from `PurchasedProductsFetcher` and adds tests.
It will be used in #2536.
Also exposed and combined the duplicated `underlyingTransaction`
implementations.