Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Log skipped subscription replacements

Neeraj Gupta5aca69c1fe7e
diff --git a/server/pkg/controller/billing.go b/server/pkg/controller/billing.go
index 8ad2a74e95..09eb375cd6 100644
--- a/server/pkg/controller/billing.go
+++ b/server/pkg/controller/billing.go
@@ -211,7 +211,16 @@ func (c *BillingController) VerifySubscription(
}
isUpgradingFromFreePlan := currentSubscription.ProductID == ente.FreePlanProductID
if shouldSkipVerifiedSubscriptionReplacement(currentSubscription, newSubscription, time.Microseconds()) {
- log.Info("Outdated or expired purchase reported")
+ log.WithFields(log.Fields{
+ "user_id": userID,
+ "stored_payment_provider": currentSubscription.PaymentProvider,
+ "stored_product_id": currentSubscription.ProductID,
+ "stored_expiry_time": currentSubscription.ExpiryTime,
+ "verified_payment_provider": newSubscription.PaymentProvider,
+ "verified_product_id": newSubscription.ProductID,
+ "verified_expiry_time": newSubscription.ExpiryTime,
+ "same_original_transaction_id": currentSubscription.OriginalTransactionID == newSubscription.OriginalTransactionID,
+ }).Info("Skipping verified subscription replacement")
return currentSubscription, nil
}
if newSubscription.Storage < currentSubscription.Storage {