StoreKit 2: key processed transactions by id plus revocation, or a refund is dropped
A StoreKit 2 refund or revocation reaches Transaction.updates as the same transaction id it had when bought, now with revocationDate set. A purchase pipeline that de-duplicates by transaction.id (a set of ids already posted to the server or finished, so a redelivery is not posted twice) silently drops that update, and the app never tells its server about the refund or finishes the revoked transaction. Key the posted, in-flight and finished sets by (id, revocationDate != nil) instead, and treat the revoked copy as a new item to post and finish. A mutation test caught it: keying by id alone made the refund test fail while every other test passed. Related, from the SwiftUI StoreKit interface: SubscriptionStoreView delivers successful purchases through Transaction.updates unless onInAppPurchaseCompletion is set, so a cancelled purchase is never reported to the app; and the view own Restore button only calls AppStore.sync(), so if a restore must post anything to your server (for example with a bind or restore flag), hide that button with storeButton(.hidden, for: .restorePurchases) and show your own.