mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
Fixes [SDKONCALL-62]. The behavior in version 3.x was that we would return a `CustomerInfo` AND the attribute errors. [The test in that version](https://github.com/RevenueCat/purchases-ios/blob/3.14.2/PurchasesTests/SubscriberAttributes/BackendSubscriberAttributesTests.swift#L370-L404) however only verified that the error was returned. When we converted `(Value, Error)` callbacks to using `Result` (#1387), I assumed this was an error. Because of that incomplete test, we didn't notice this wasn't the desired behavior. If the backend returns a 200, it's assumed that the errors aren't more important than the correct `CustomerInfo`. The new implementation simply logs the attribute errors (which is now tested), and returns the `CustomerInfo`: ``` 😿‼️ One or more of the attributes sent could not be saved. ["$email": "email is not in valid format"] ``` [SDKONCALL-62]: https://revenuecats.atlassian.net/browse/SDKONCALL-62?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
29 lines
695 B
JSON
29 lines
695 B
JSON
{
|
|
"headers" : {
|
|
"Authorization" : "Bearer the api key"
|
|
},
|
|
"request" : {
|
|
"body" : {
|
|
"app_user_id" : "abc123",
|
|
"attributes" : {
|
|
"$attConsentStatus" : {
|
|
"updated_at_ms" : 1678307200000,
|
|
"value" : "authorized"
|
|
},
|
|
"a key" : {
|
|
"updated_at_ms" : 1678307200000,
|
|
"value" : "a value"
|
|
},
|
|
"another key" : {
|
|
"updated_at_ms" : 1678307200000,
|
|
"value" : "another value"
|
|
}
|
|
},
|
|
"fetch_token" : "YW4gYXdlc29tZSByZWNlaXB0",
|
|
"is_restore" : false,
|
|
"observer_mode" : false
|
|
},
|
|
"method" : "POST",
|
|
"url" : "https://api.revenuecat.com/v1/receipts"
|
|
}
|
|
} |