TrialOrIntroPriceEligibilityChecker: fixed integration test to ensure receipt is always loaded#1726
Conversation
057936a to
c90c1cc
Compare
There was a problem hiding this comment.
cc @aboedo any reason why this should be .never?
There was a problem hiding this comment.
yeah, sadly.
refreshing here will likely prompt the user for their credentials, and intro eligibility should be triggered programmatically.
In theory, this should only be a problem in sandbox, but I have a vague recollection of having moved to never after this caused a lot of customer confusion and headaches
There was a problem hiding this comment.
Oooh that's right.
This test failure exposed a real issue, but considering this is for pre-iOS 15 only, and that downside, maybe we should leave it as .never, but I'll change the test to force a receipt refresh.
How does that sound?
There was a problem hiding this comment.
that makes total sense.
Also, would you mind adding what I explained as a comment? Your question about why this should be .never is very valid and there's no reason maintainers should know the explanation before seeing this code, I should have added a comment myself when adding the .never 🤦
c90c1cc to
3795091
Compare
TrialOrIntroPriceEligibilityChecker: fixed SK1 logicTrialOrIntroPriceEligibilityChecker: refresh receipts in sandbox
|
@aboedo I've updated this:
Because Integration Tests aren't detecting "sandbox" I still need those tests separately. |
For some reason the url is `[app_bundle]/StoreKit/receipt` in integration tests. This is not correct, so I've added a couple of tests: one for entitlements, and another one to check the raw output value of that property. This is necessary to make sure that receipts are loaded correctly after #1726.
For some reason the url is `[app_bundle]/StoreKit/receipt` in integration tests. This is not correct, so I've added a couple of tests: one for entitlements, and another one to check the raw output value of that property. This is necessary to make sure that receipts are loaded correctly after #1726.
3795091 to
ac26c62
Compare
There was a problem hiding this comment.
Just rebased. Integration tests will use this now :)
|
All tests passing 🎉 |
ac26c62 to
b1c2790
Compare
TrialOrIntroPriceEligibilityChecker: refresh receipts in sandboxTrialOrIntroPriceEligibilityChecker: fixed integration test to ensure receipt is always loaded
b1c2790 to
bdec362
Compare
The reason the receipt data is required, is because if it's `nil`, it ends up becoming empty because of `data ?? Data()`, but `GetIntroEligibilityOperation` never actually runs because that's empty.
bdec362 to
711da9e
Compare

The reason the receipt data is required, is because if it's
nil, it ends up becoming empty because ofdata ?? Data(), butGetIntroEligibilityOperationnever actually runs because that's empty.To make sure the test doesn't fail, we begin by ensuring the receipt data is loaded first.
Also documented the reason for
ReceiptRefreshPolicy.never.