Commit Graph
15 Commits
Author SHA1 Message Date
Antonio Pallares 0ec39f66ae Fix potential wrong count on diagnosis sync (#4846)
* fix: potential count desync in `DiagnosticsSynchronizer`

* tests: add unit tests for invalid entry lines in local diagnostics file
2025-03-04 08:55:05 +01:00
Antonio Pallares f7fa5d2e81 [Diagnostics] Add extra parameters to applePurchaseAttempt (#4835)
* 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
2025-03-03 14:38:00 +01:00
Toni Rico 8f5a9488e0 [Diagnostics] Add requestedProductIds and notFoundProductIds to appleProductsRequest (#4828) 2025-02-28 09:43:19 +01:00
Facundo Menzella 6b5c430082 chore: Enable force_unwrapping for SwiftLint (#4820)
* enable force_unwrapping

* avoid force unwrap

* fixed all errors

* remove extra disable
2025-02-26 12:40:49 +01:00
Mark Villacampa 6f8e53ac40 Fix Xcode 16 warnings (#4334)
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)
2024-10-02 11:53:45 +02:00
Toni Rico f95799901a [Diagnostics] Add apple_products_request event (#4247)
* [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
2024-09-26 14:46:16 +02:00
Cesar de la Vega 93e3f3f477 [Diagnostics] Add apple_purchase_attempt event (#4253) 2024-09-25 16:41:05 +02:00
Toni Rico 597af5f215 [Diagnostics] Add backend_error_code property (#4236)
<!-- 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.
2024-09-04 09:03:34 +02:00
Toni Rico ffe5b8b363 Diagnostics: Add logic to retry on server errors (#3930)
### 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).
2024-06-03 13:57:59 +02:00
Toni Rico bb8066d9b3 Add http_request_performed diagnostics event (#3897)
### 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.
2024-05-16 15:13:40 +02:00
Toni Rico 0a534c8260 Clear diagnostics file if we detect it's too big during event tracking (#3824)
### 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.
2024-05-10 17:00:28 +02:00
Cesar de la Vega 5e0bc32867 Add diagnostics event for Customer Info verification (#3823)
Track CustomerInfo verification results
2024-04-25 23:03:45 +02:00
c55c03d678 Add DiagnosticsSynchronizer (#3787)
Adds capability to synchronize diagnostics events from the JSONL file to
the backend

---------

Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
Co-authored-by: James <109382862+jamesrb1@users.noreply.github.com>
2024-04-16 13:18:31 +02:00
Cesar de la Vega f813e3217b Create DiagnosticsPostOperation (#3795)
Add DiagnosticsPostOperation and DiagnosticsAPI
2024-04-11 17:12:04 +02:00
Cesar de la Vega 03d93bb061 Add HTTPRequest.DiagnosticsPath (#3791)
Create DiagnosticsHTTPRequestPath for Diagnostics

Depends on #3790 which adds the name
2024-04-10 13:00:48 +02:00