Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StoreKitObserverModeIntegrationTests: added test for posting renewals #2590

Merged
merged 5 commits into from
Jun 14, 2023

Conversation

NachoSoto
Copy link
Contributor

@NachoSoto NachoSoto commented Jun 6, 2023

Follow up to #2589.
Depends on #2612.

@NachoSoto NachoSoto added the test label Jun 6, 2023
@NachoSoto NachoSoto requested review from joshdholtz and a team June 6, 2023 16:06
@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch from a901d0d to 3ab9233 Compare June 6, 2023 16:07
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

💪

@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch from 3ab9233 to 25c5bcb Compare June 6, 2023 22:03
Base automatically changed from observer-mode-sk2-test-failure to main June 6, 2023 22:15
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #2590 (6274c39) into main (4b14260) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 6274c39 differs from pull request most recent head 4ac8415. Consider uploading reports for the commit 4ac8415 to get more accurate results

@@            Coverage Diff             @@
##             main    #2590      +/-   ##
==========================================
- Coverage   88.07%   88.04%   -0.03%     
==========================================
  Files         201      201              
  Lines       14031    14024       -7     
==========================================
- Hits        12358    12348      -10     
- Misses       1673     1676       +3     

see 3 files with indirect coverage changes

@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch 2 times, most recently from ec8fbd8 to 443015e Compare June 6, 2023 22:18
@NachoSoto NachoSoto enabled auto-merge (squash) June 6, 2023 22:21
@NachoSoto NachoSoto disabled auto-merge June 7, 2023 16:24
@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch from 4ac8415 to 4c58da8 Compare June 7, 2023 16:54
@NachoSoto
Copy link
Contributor Author

This is passing locally but not in CI, can't figure out why.

@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch 2 times, most recently from 2b0a859 to 77a1d0e Compare June 12, 2023 16:14
@NachoSoto NachoSoto changed the base branch from main to nacho/sdk-3170-always-initialize-storekit2transactionlistener-even-on-sk1 June 12, 2023 21:56
@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch from 58ef3a5 to 19e4c27 Compare June 12, 2023 23:00
NachoSoto added a commit that referenced this pull request Jun 12, 2023
Looks like `Storefront.current` is usually `nil` during tests.
After #2612, it's important than renewals posted from SK1 and SK2 end up with equivalent cache keys. This will be ensured by a test in #2590, which breaks unless we do this.
Example cache keys between SK1 and SK2:
```
PostReceiptDataOperation $RCAnonymousID:9d38b05059d442b082f915011041bbcb-true-77c15e6fad291c0ff9bf8a4efdfa21eca7cdd74e7a0a4a1bdcf320e8ddcfc2d5\n-com.revenuecat.monthly_4.99.no_intro-0.99-USD-USA--1-0-7096FF06-P1M---1-com.revenuecat.monthly_4.99.1_free_week\n--true\n-[\"$attConsentStatus\": [SubscriberAttribute] key: $attConsentStatus value: notDetermined setTime: 2023-06-12 22:31:56 +0000]
PostReceiptDataOperation $RCAnonymousID:9d38b05059d442b082f915011041bbcb-true-77c15e6fad291c0ff9bf8a4efdfa21eca7cdd74e7a0a4a1bdcf320e8ddcfc2d5\n-com.revenuecat.monthly_4.99.no_intro-0.99-USD---1-0-7096FF06-P1M---1-com.revenuecat.monthly_4.99.1_free_week\n--true\n-["$attConsentStatus": [SubscriberAttribute] key: $attConsentStatus value: notDetermined setTime: 2023-06-12 22:31:56 +0000]
```

Notice `USA` is missing on the SK2 posted product.
@NachoSoto NachoSoto force-pushed the nacho/sdk-3170-always-initialize-storekit2transactionlistener-even-on-sk1 branch from 2ef65c1 to 77d1f77 Compare June 13, 2023 14:45
@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch from 19e4c27 to 364f53b Compare June 13, 2023 14:47
Base automatically changed from nacho/sdk-3170-always-initialize-storekit2transactionlistener-even-on-sk1 to main June 14, 2023 19:47
@NachoSoto NachoSoto force-pushed the observer-mode-renewal-integration-test branch from 364f53b to 8b07e55 Compare June 14, 2023 20:02
@NachoSoto NachoSoto enabled auto-merge (squash) June 14, 2023 20:02
@NachoSoto NachoSoto merged commit 7cfbfe0 into main Jun 14, 2023
@NachoSoto NachoSoto deleted the observer-mode-renewal-integration-test branch June 14, 2023 20:18
NachoSoto pushed a commit that referenced this pull request Jun 22, 2023
**This is an automatic release.**

### Bugfixes
* `PurchasesOrchestrator`: update `CustomerInfoManager` cache after
processing transactions (#2676) via NachoSoto (@NachoSoto)
* `ErrorResponse`: drastically improved error messages, no more "unknown
error"s (#2660) via NachoSoto (@NachoSoto)
* `PaywallExtensions`: post purchases with `Offering` identifier (#2645)
via NachoSoto (@NachoSoto)
* Support `product_plan_identifier` for purchased subscriptions from
`Google Play` (#2654) via Josh Holtz (@joshdholtz)
### Performance Improvements
* `copy(with: VerificationResult)`: optimization to avoid copies (#2639)
via NachoSoto (@NachoSoto)
### Other Changes
* `ETagManager`: refactored e-tag creation and tests (#2671) via
NachoSoto (@NachoSoto)
* `getPromotionalOffer`: return `ErrorCode.ineligibleError` if receipt
is not found (#2678) via NachoSoto (@NachoSoto)
* `TimingUtil`: removed slow purchase logs (#2677) via NachoSoto
(@NachoSoto)
* `CI`: changed `Codecov` to `informational` (#2670) via NachoSoto
(@NachoSoto)
* `LoadShedderIntegrationTests`: verify requests are actually handled by
load shedder (#2663) via NachoSoto (@NachoSoto)
* `ETagManager.httpResultFromCacheOrBackend`: return response headers
(#2666) via NachoSoto (@NachoSoto)
* `Integration Tests`: added tests to verify 304 behavior (#2659) via
NachoSoto (@NachoSoto)
* `HTTPClient`: disable `URLSession` cache (#2668) via NachoSoto
(@NachoSoto)
* Documented `HTTPStatusCode.isSuccessfullySynced` (#2661) via NachoSoto
(@NachoSoto)
* `NetworkError.signatureVerificationFailed`: added status code to error
`userInfo` (#2657) via NachoSoto (@NachoSoto)
* `HTTPClient`: improved log for failed requests (#2669) via NachoSoto
(@NachoSoto)
* `ETagManager`: added new verbose logs (#2656) via NachoSoto
(@NachoSoto)
* `Signature Verification`: added test-only log for debugging invalid
signatures (#2658) via NachoSoto (@NachoSoto)
* Fixed `HTTPResponse.description` (#2664) via NachoSoto (@NachoSoto)
* Changed `Logger` to use `os_log` (#2608) via NachoSoto (@NachoSoto)
* `MainThreadMonitor`: increased threshold (#2662) via NachoSoto
(@NachoSoto)
* `debugRevenueCatOverlay`: display `receiptURL` (#2652) via NachoSoto
(@NachoSoto)
* `PurchaseTester`: added ability to display `debugRevenueCatOverlay`
(#2653) via NachoSoto (@NachoSoto)
* `debugRevenueCatOverlay`: ability to close on `macOS`/`Catalyst`
(#2649) via NachoSoto (@NachoSoto)
* `debugRevenueCatOverlay`: added support for `macOS` (#2648) via
NachoSoto (@NachoSoto)
* `LoadShedderIntegrationTests`: enable signature verification (#2655)
via NachoSoto (@NachoSoto)
* `ImageSnapshot`: fixed Xcode 15 compilation (#2651) via NachoSoto
(@NachoSoto)
* `OfferingsManager`: don't clear offerings cache timestamp when request
fails (#2359) via NachoSoto (@NachoSoto)
* `StoreKitObserverModeIntegrationTests`: added test for posting
renewals (#2590) via NachoSoto (@NachoSoto)
* Always initialize `StoreKit2TransactionListener` even on SK1 mode
(#2612) via NachoSoto (@NachoSoto)
* `ErrorUtils.missingReceiptFileError`: added receipt URL `userInfo`
context (#2650) via NachoSoto (@NachoSoto)
* Added `.xcprivacy` for Xcode 15 (#2619) via NachoSoto (@NachoSoto)
* `Trusted Entitlements`: added debug log with
`ResponseVerificationMode` (#2647) via NachoSoto (@NachoSoto)
* `debugRevenueCatOverlay`: simplified title (#2641) via NachoSoto
(@NachoSoto)
* Simplified `Purchases.updateAllCachesIfNeeded` (#2626) via NachoSoto
(@NachoSoto)
* `HTTPResponseTests`: fixed disabled test (#2643) via NachoSoto
(@NachoSoto)
* Add `InternalDangerousSettings.forceSignatureFailures` (#2635) via
NachoSoto (@NachoSoto)
* `IntegrationTests`: explicit `StoreKit 1` mode (#2636) via NachoSoto
(@NachoSoto)
* `Signing`: removed API for loading key from a file (#2638) via
NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants