Skip to content

Commit

Permalink
FIx the bug observed in the integration attempt
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CarlosNihelton committed Oct 10, 2023
1 parent c5c085f commit c9add5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storeapi/base/impl/StoreContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit c9add5e

Please sign in to comment.