Skip to content

CustomerInfo: support parsing schema version 2 to restore SDK v3.x compatibility#2213

Merged
NachoSoto merged 2 commits into
mainfrom
customer-info-schema-version-2
Jan 17, 2023
Merged

CustomerInfo: support parsing schema version 2 to restore SDK v3.x compatibility#2213
NachoSoto merged 2 commits into
mainfrom
customer-info-schema-version-2

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Jan 12, 2023

Copy link
Copy Markdown
Contributor

Fixes TRIAGE-240.

When we converted CustomerInfo to use Codable (#1496), the schema version was also changed from 2 to 3.
I don't remember if this was done on purpose, but turns out that it was not necessary.

This means that a user opening an app while offline, after upgrading from version 3.x to 4.x (>= 4.3), would not have a cached CustomerInfo and therefore no entitlements.
This fixes that by restoring support and adding a specific test with a sample version 2 JSON (which is virtually identical).

Fies [TRIAGE-240].

When we converted `CustomerInfo` to use `Codable` (#1496), the schema version was also changed from 2 to 3.
I don't remember if this was done on purpose, but turns out that it was not necessary.

This means that a user opening an app while offline, after upgrading from version `3.x` to `4.x` (>= `4.3`), they would not have a cached `CustomerInfo` and therefore no entitlements.
This fixes that by restoring support and adding a specific test with a sample version 2 JSON (which is virtually identical).
@NachoSoto NachoSoto added the pr:fix A bug fix label Jan 12, 2023
@NachoSoto NachoSoto requested a review from a team January 12, 2023 22:22

@aboedo aboedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is also the case for Android, could you fix it there as well?

@NachoSoto NachoSoto merged commit 01bfb5b into main Jan 17, 2023
@NachoSoto NachoSoto deleted the customer-info-schema-version-2 branch January 17, 2023 15:13
NachoSoto pushed a commit that referenced this pull request Jan 17, 2023
**This is an automatic release.**

### New Features
* Added new `ReceiptParser.fetchAndParseLocalReceipt` (#2204) via
NachoSoto (@NachoSoto)
* `PurchasesReceiptParser`: added API to parse receipts from `base64`
string (#2200) via NachoSoto (@NachoSoto)
### Bugfixes
* `CustomerInfo`: support parsing schema version 2 to restore SDK `v3.x`
compatibility (#2213) via NachoSoto (@NachoSoto)
### Other Changes
* `JSONDecoder`: added decoding type when logging
`DecodingError.keyNotFound` (#2212) via NachoSoto (@NachoSoto)
* Added `ReceiptParserTests` (#2203) via NachoSoto (@NachoSoto)
* Deploy `PurchaseTester` for `macOS` (#2011) via NachoSoto (@NachoSoto)
* `ReceiptFetcher`: refactored implementation to log error when failing
to fetch receipt (#2202) via NachoSoto (@NachoSoto)
* `PostReceiptDataOperation`: replaced receipt `base64` with `hash` for
cache key (#2199) via NachoSoto (@NachoSoto)
* `PurchaseTester`: small refactor to simplify `Date` formatting (#2210)
via NachoSoto (@NachoSoto)
* `PurchasesReceiptParser`: improved documentation to reference
`default` (#2197) via NachoSoto (@NachoSoto)
* Created `CachingTrialOrIntroPriceEligibilityChecker` (#2007) via
NachoSoto (@NachoSoto)
* Update Gemfile.lock (#2205) via Cesar de la Vega (@vegaro)
* remove stalebot in favor of SLAs in Zendesk (#2196) via Andy Boedo
(@aboedo)
* Update fastlane-plugin-revenuecat_internal to latest version (#2194)
via Cesar de la Vega (@vegaro)
@NachoSoto

Copy link
Copy Markdown
Contributor Author

@aboedo Android has a schema version of 3, but looks like it's been that since 2020, so I'm guessing the last time it changed was deliberate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants