[Billing Plans]: Update product caching cache key#6801
Merged
Conversation
JZDesign
approved these changes
May 14, 2026
ajpallares
reviewed
May 15, 2026
|
|
||
| expect(result.onlyElement) === product | ||
| self.expectProductsWereFetched(times: 1, for: product.id) | ||
| } |
Member
There was a problem hiding this comment.
If I understood correctly, should we add an extra test for the same productIdentifier but different id so that cachingManager.products returns the same product 2 times (1 per installment info)?
Like the example stated in the PR description: com.rc.product and com.rc.product:monthly
Contributor
Author
There was a problem hiding this comment.
Good idea! :D
Added that test + several others in 7403322
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Modifies the SDK's product cache to use
StoreProduct.idinstead of theproductIdentifier. This allows us to avoid cache key conflicts for products with billing plans since the cache will now store separate values forcom.rc.productandcom.rc.product:monthly.Note
Medium Risk
Changes the cache key used for StoreKit product lookups, which can alter cache hit/miss behavior and increase product fetches if any callers still request by
productIdentifierinstead ofStoreProduct.id. Covered by new unit tests around base vs billing-plan IDs, but impacts purchasing performance/behavior paths.Overview
Product caching now keys entries by
StoreProduct.idinstead ofproductIdentifier, so billing-plan variants likecom.rc.product:monthlyno longer overwrite or satisfy requests for the basecom.rc.product(and vice versa).Adds focused unit tests to verify correct cache behavior for base vs installment/billing-plan products: cached hits by
id, no cross-serving between base and monthly IDs, and mixed requests only fetch missing IDs.Reviewed by Cursor Bugbot for commit 3ac1f6c. Bugbot is set up for automated code reviews on this repo. Configure here.