* feat: add missing properties to `apple_purchase_attempt` diagnostics event
* tests: add + edit unit tests for new diagnostics parameters for SK1 purchase attempt
* fix implementation of sk2 product purchase to catch promotional offer signature error again
* tests: edit unit tests for new diagnostics parameters for SK2 purchase attempt
* fix failing test
* refactor: separate error handling in purchase SK2 product method into its own method
* address PR #4835 comments
* lint
When compiling with Xcode 16, we started throwing a bunch of new warnings. Here's a list and explanation of each:
- The most common one was needing to explicitly restate the @unchecked Sendable conformance from a parent class.
- There were a couple switches where a new entry was added in tvOS but only for iOS 18, and needed to add it to make it exhaustive.
- There we a couple of places where we were adding a protocol conformance to a class from a different module e.g. extension DispatchTimeInterval: Comparable. This is considered unsafe now because the owners of the module could add the conformance later. Solved by removing the conformance which wasn't being used widely in the codebase, only in tests.
- Finally there was a class where we were capturing SKRequest and SKProductsRequest instances in a sendable block, but only to either log something, or use them as dictionary key, so I just made the classes Sendable (with the new @retroactice attribute because they belong to a different module)
* [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
<!-- Thank you for contributing to Purchases! Before pressing the
"Create Pull Request" button, please provide the following: -->
### Checklist
- [ ] If applicable, unit tests
- [ ] If applicable, create follow-up issues for `purchases-android` and
hybrids
### Motivation
<!-- Why is this change required? What problem does it solve? -->
<!-- Please link to issues following this format: Resolves#999999 -->
### Description
This adds the `backend_error_code` property to diagnostics
`http_request_performed` events.
### Description
This will make sure that we delete the diagnostics file if there is an
issue syncing it over multiple retries (note these retries only happen
during SDK configuration).
### Description
This adds a new diagnostics event `http_request_performed` with some
useful information we would like to track about the http requests
performed to our servers.
### Description
This makes it so, if we detect the diagnostics file gets too big while
tracking an event, we just clear it and start over. Additionally, we add
an event tracking that this happened to the diagnostics file.