Logging: avoid logging "updating offerings" when request is cached#2904
Merged
Conversation
Contributor
Author
f1e9ecb to
cc0f2f2
Compare
25346af to
ff1e7be
Compare
aboedo
approved these changes
Jul 31, 2023
ff1e7be to
081dad7
Compare
Codecov Report
@@ Coverage Diff @@
## main #2904 +/- ##
==========================================
- Coverage 86.65% 86.59% -0.06%
==========================================
Files 218 217 -1
Lines 15559 15536 -23
==========================================
- Hits 13482 13453 -29
- Misses 2077 2083 +6
|
3dc2c5b to
c2e8da0
Compare
Base automatically changed from
nacho/sdk-3243-422s-fix-bug-where-transactions-are-misidentified-as
to
main
August 7, 2023 22:57
I noticed this in our logs: ``` [offering] DEBUG: ℹ️ No cached Offerings, fetching from network [purchases] VERBOSE: Updating all caches [offering] DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground [offering] DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground [network] DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe...'. Skipping request. [network] DEBUG: ℹ️ GetOfferingsOperation: Started ``` The double "updating from network" can be confusing, so this fixes it so it's only logged if the request will actually be started. Also added/updated our tests to verify the correct logs as well as caching behavior.
081dad7 to
49befff
Compare
This was referenced Aug 9, 2023
NachoSoto
added a commit
that referenced
this pull request
Aug 9, 2023
_This release is compatible with Xcode 15 beta 6 and visionOS beta 3_ ### Bugfixes * `visionOS`: support for `Xcode 15 beta 6` (#2989) via NachoSoto (@NachoSoto) * `CachingProductsManager`: avoid crash when caching different products with same identifier (#2979) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: disambiguate transactions from the queue (#2890) via NachoSoto (@NachoSoto) ### Performance Improvements * `StoreKit2TransactionListener`: handle transactions asynchronously (#2910) via NachoSoto (@NachoSoto) ### Other Changes * `Atomic`: avoid race conditions modifying dictionaries (#2981) via NachoSoto (@NachoSoto) * `Logging`: avoid logging "updating offerings" when request is cached (#2904) via NachoSoto (@NachoSoto) * `StoreKit2TransactionListener`: converted into an `actor` (#2909) via NachoSoto (@NachoSoto) * `Integration Tests`: added more observer mode tests (#2905) via NachoSoto (@NachoSoto) * Created `PostedTransactionCache` (#2911) via NachoSoto (@NachoSoto) * `IntroEligibility`: changed products to `Set<String>` (#2976) via NachoSoto (@NachoSoto) * `AdServices`: Rename `postAdServicesTokenIfNeeded()` to `postAdServicesTokenOncePerInstallIfNeeded()` (#2968) via Josh Holtz (@joshdholtz) * `SK1StoreProduct`: changed `productType` warning to debug (#2957) via NachoSoto (@NachoSoto) * `PrivacyInfo.xcprivacy`: added `UserDefaults` to access API types (#2913) via NachoSoto (@NachoSoto) * `Integration Tests`: new test to verify that SK1 purchases don't leave SK2 unfinished transactions (#2906) via NachoSoto (@NachoSoto) * `Logging`: log entire cache key with verbose logs (#2888) via NachoSoto (@NachoSoto) * `StoreProduct`: added test covering warning log (#2897) via NachoSoto (@NachoSoto) * `CustomEntitlementComputation`: use custom API key (#2879) via Toni Rico (@tonidero) * `CachingProductsManager`: removed duplicate log and added tests (#2898) via NachoSoto (@NachoSoto) * `Xcode 15 beta 5`: fixed test compilation (#2885) via NachoSoto (@NachoSoto) --------- Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
MarkVillacampa
pushed a commit
that referenced
this pull request
Sep 6, 2023
…2904) I noticed this in our logs: ``` [offering] DEBUG: ℹ️ No cached Offerings, fetching from network [purchases] VERBOSE: Updating all caches [offering] DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground [offering] DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground [network] DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe...'. Skipping request. [network] DEBUG: ℹ️ GetOfferingsOperation: Started ``` The double "updating from network" can be confusing, so this fixes it so it's only logged if the request will actually be started. Also added/updated our tests to verify the correct logs as well as caching behavior.
MarkVillacampa
pushed a commit
that referenced
this pull request
Sep 6, 2023
_This release is compatible with Xcode 15 beta 6 and visionOS beta 3_ ### Bugfixes * `visionOS`: support for `Xcode 15 beta 6` (#2989) via NachoSoto (@NachoSoto) * `CachingProductsManager`: avoid crash when caching different products with same identifier (#2979) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: disambiguate transactions from the queue (#2890) via NachoSoto (@NachoSoto) ### Performance Improvements * `StoreKit2TransactionListener`: handle transactions asynchronously (#2910) via NachoSoto (@NachoSoto) ### Other Changes * `Atomic`: avoid race conditions modifying dictionaries (#2981) via NachoSoto (@NachoSoto) * `Logging`: avoid logging "updating offerings" when request is cached (#2904) via NachoSoto (@NachoSoto) * `StoreKit2TransactionListener`: converted into an `actor` (#2909) via NachoSoto (@NachoSoto) * `Integration Tests`: added more observer mode tests (#2905) via NachoSoto (@NachoSoto) * Created `PostedTransactionCache` (#2911) via NachoSoto (@NachoSoto) * `IntroEligibility`: changed products to `Set<String>` (#2976) via NachoSoto (@NachoSoto) * `AdServices`: Rename `postAdServicesTokenIfNeeded()` to `postAdServicesTokenOncePerInstallIfNeeded()` (#2968) via Josh Holtz (@joshdholtz) * `SK1StoreProduct`: changed `productType` warning to debug (#2957) via NachoSoto (@NachoSoto) * `PrivacyInfo.xcprivacy`: added `UserDefaults` to access API types (#2913) via NachoSoto (@NachoSoto) * `Integration Tests`: new test to verify that SK1 purchases don't leave SK2 unfinished transactions (#2906) via NachoSoto (@NachoSoto) * `Logging`: log entire cache key with verbose logs (#2888) via NachoSoto (@NachoSoto) * `StoreProduct`: added test covering warning log (#2897) via NachoSoto (@NachoSoto) * `CustomEntitlementComputation`: use custom API key (#2879) via Toni Rico (@tonidero) * `CachingProductsManager`: removed duplicate log and added tests (#2898) via NachoSoto (@NachoSoto) * `Xcode 15 beta 5`: fixed test compilation (#2885) via NachoSoto (@NachoSoto) --------- Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
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.
I noticed this in our logs:
The double "updating from network" can be confusing, so this fixes it so it's only logged if the request will actually be started. Also added/updated our tests to verify the correct logs as well as caching behavior.