Skip to content

Commit 10063a1

Browse files
Leverclaude
andcommitted
Fix comment: expired override is not redundant
Both .revoked and .expired are necessary overrides — the first pass can incorrectly compute isActive = true from stale transactions in Transaction.all regardless of the subscription-level state. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 50ff6c5 commit 10063a1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Sources/SuperwallKit/StoreKit/Products/Receipt Manager/EntitlementProcessor.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,11 @@ enum EntitlementProcessor {
394394
if let entitlements = finalEntitlementsByProductId[productId] {
395395
var updatedEntitlements: Set<Entitlement> = []
396396
for entitlement in entitlements where entitlement.id == entitlementId {
397-
// Revoked: authoritative override required. Apple may not set
398-
// revocationDate on every transaction under the same
399-
// originalTransactionId, so the first pass can incorrectly
400-
// return isActive = true for a refunded subscription.
401-
//
402-
// Expired: redundant but defensive — the first pass already
403-
// computes isActive = false when expirationDate <= now.
397+
// The subscription-level state from subscriptionStatus is
398+
// authoritative. The first pass may incorrectly compute
399+
// isActive = true when Transaction.all contains a transaction
400+
// without revocationDate or with a future expirationDate, even
401+
// though the subscription as a whole is revoked or expired.
404402
let resolvedIsActive: Bool
405403
if state == .revoked || state == .expired {
406404
resolvedIsActive = false

0 commit comments

Comments
 (0)