diff --git a/Sources/Logging/Strings/PurchaseStrings.swift b/Sources/Logging/Strings/PurchaseStrings.swift index 3dbe38e867..f333145dc4 100644 --- a/Sources/Logging/Strings/PurchaseStrings.swift +++ b/Sources/Logging/Strings/PurchaseStrings.swift @@ -77,8 +77,6 @@ enum PurchaseStrings { case sk2_transactions_update_received_transaction(productID: String) case transaction_poster_handling_transaction(productID: String, offeringID: String?) case caching_presented_offering_identifier(offeringID: String, productID: String) - case sk1_purchase_too_slow - case sk2_purchase_too_slow case payment_queue_wrapper_delegate_call_sk1_enabled case restorepurchases_called_with_allow_sharing_appstore_account_false @@ -297,12 +295,6 @@ extension PurchaseStrings: LogMessage { case let .caching_presented_offering_identifier(offeringID, productID): return "Caching presented offering identifier '\(offeringID)' for product '\(productID)'" - case .sk1_purchase_too_slow: - return "StoreKit 1 purchase took longer than expected" - - case .sk2_purchase_too_slow: - return "StoreKit 2 purchase took longer than expected" - case .payment_queue_wrapper_delegate_call_sk1_enabled: return "Unexpectedly received PaymentQueueWrapperDelegate call with SK1 enabled" diff --git a/Sources/Purchasing/Configuration.swift b/Sources/Purchasing/Configuration.swift index a06ab1642d..b7c92f2b1c 100644 --- a/Sources/Purchasing/Configuration.swift +++ b/Sources/Purchasing/Configuration.swift @@ -297,7 +297,6 @@ extension Configuration { internal enum TimingThreshold: TimingUtil.Duration { case productRequest = 3 - case purchase = 7 case introEligibility = 2 case purchasedProducts = 1 diff --git a/Sources/Purchasing/Purchases/PurchasesOrchestrator.swift b/Sources/Purchasing/Purchases/PurchasesOrchestrator.swift index 4dae2deab1..30924510c5 100644 --- a/Sources/Purchasing/Purchases/PurchasesOrchestrator.swift +++ b/Sources/Purchasing/Purchases/PurchasesOrchestrator.swift @@ -440,24 +440,20 @@ final class PurchasesOrchestrator { let result: Product.PurchaseResult do { - result = try await TimingUtil.measureAndLogIfTooSlow( - threshold: .purchase, - message: Strings.purchase.sk2_purchase_too_slow.description) { - var options: Set = [ - .simulatesAskToBuyInSandbox(Purchases.simulatesAskToBuyInSandbox) - ] - - if let signedData = promotionalOffer { - Logger.debug( - Strings.storeKit.sk2_purchasing_added_promotional_offer_option(signedData.identifier) - ) - options.insert(try signedData.sk2PurchaseOption) - } + var options: Set = [ + .simulatesAskToBuyInSandbox(Purchases.simulatesAskToBuyInSandbox) + ] - self.cachePresentedOfferingIdentifier(package: package, productIdentifier: sk2Product.id) + if let signedData = promotionalOffer { + Logger.debug( + Strings.storeKit.sk2_purchasing_added_promotional_offer_option(signedData.identifier) + ) + options.insert(try signedData.sk2PurchaseOption) + } - return try await sk2Product.purchase(options: options) - } + self.cachePresentedOfferingIdentifier(package: package, productIdentifier: sk2Product.id) + + result = try await sk2Product.purchase(options: options) } catch StoreKitError.userCancelled { guard !self.systemInfo.dangerousSettings.customEntitlementComputation else { throw ErrorUtils.purchaseCancelledError()