Commit Graph
7 Commits
Author SHA1 Message Date
NachoSoto 9872dcac01 Renamed Decoder.throwValueNotFoundError (#1569)
The method doesn't actually throw, so calling `throw decoder.throwValueNotFoundError()` was confusing. Now the code reads `throw decoder.valueNotFoundError()`.
2022-05-23 18:27:35 -07:00
NachoSoto 56e3519ec1 Added tests for PeriodType/PurchaseOwnershipType/Store (#1558)
Follow up to #1551. Using `Codable.encodeAndDecode` we ensure that each value can be bidirectionally converted.
These tests exposed that unknown values were being encoded as `null`, but then failed to decode.

I've updated the implementation and added a few more tests to cover this behavior.
2022-05-19 11:27:12 -07:00
Will Taylor 80815c8cf8 Rename AmazonStore to Amazon to match Android SDK naming conventions 2022-05-19 12:37:46 -05:00
Will Taylor d2b5f55700 Add AmazonStore to Store enum 2022-05-19 10:58:52 -05:00
NachoSoto 30c1973c7a PeriodType/PurchaseOwnershipType/Store: conform to Encodable (#1551)
These will be used in an upcoming PR.
2022-05-10 08:47:42 -07:00
NachoSoto f9a8d68399 Fixed ErrorUtils.logDecodingError (#1539)
## Changes:

- Improved output of decoding errors:

#### Before:
```
[Purchases] - ERROR: 😿‼️ Couldn't decode data from json. Error:
The operation couldn’t be completed. (RevenueCat.CodableError error 0.))
```

#### After:
```
[Purchases] - ERROR: 😿‼️ Couldn't decode data from json. Error:
Found unexpected value 'tienda' for type 'Store'
```

- `CodableStrings.decodingError` relied on `Error.localizedDescription`, so `CodableError` now conforms to `LocalizedError` to provide that as well
- Added incorrect `value` to the error to find out why it was invalid
- Removed extra `)` at the end of the error string
- Cleaned up `switch`es to use a single `let` syntax
2022-04-26 10:48:02 -07:00
aboedo f5697de730 renamed Purchases folder to Sources (#1416)
* renamed `Purchases` folder to `Sources`

* temporarily enabling installation test jobs

* re-disabling installation test jobs
2022-03-28 11:53:24 -03:00