From c9add5ea0696a85cdb484d708844d4b36f1c3e56 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 10 Oct 2023 15:06:55 -0300 Subject: [PATCH] FIx the bug observed in the integration attempt The product SKUs seen in debug show either `IsSubscription` or `IsInUserCollection` properties ON. Never both. So, I'm relaxing the first property in favor of the second, when computing the expiration date. --- storeapi/base/impl/StoreContext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storeapi/base/impl/StoreContext.cpp b/storeapi/base/impl/StoreContext.cpp index 2a5f60077..d3f0954e8 100644 --- a/storeapi/base/impl/StoreContext.cpp +++ b/storeapi/base/impl/StoreContext.cpp @@ -38,9 +38,11 @@ winrt::hstring sha256(winrt::hstring input); std::chrono::system_clock::time_point StoreContext::Product::CurrentExpirationDate() const { - // A single product might have more than one SKU. + // A single product might have more than one SKU and not all of them + // (maybe none) show both `IsSubscription` and `IsInUserCollection` properties + // simultaneously true. for (auto sku : self.Skus()) { - if (sku.IsInUserCollection() && sku.IsSubscription()) { + if (sku.IsInUserCollection()) { auto collected = sku.CollectionData(); return winrt::clock::to_sys(collected.EndDate()); }