mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Move pending payment check above subscription checks.
This commit is contained in:
@@ -118,6 +118,8 @@ class InAppPaymentKeepAliveJob private constructor(
|
||||
return
|
||||
}
|
||||
|
||||
clearOldPendingPaymentsIfRequired()
|
||||
|
||||
if (SignalDatabase.inAppPayments.hasPrePendingRecurringTransaction(type.inAppPaymentType)) {
|
||||
info(type, "We are currently processing a transaction for this type. Skipping.")
|
||||
return
|
||||
@@ -151,8 +153,6 @@ class InAppPaymentKeepAliveJob private constructor(
|
||||
return
|
||||
}
|
||||
|
||||
clearOldPendingPaymentsIfRequired()
|
||||
|
||||
val activeInAppPayment = getActiveInAppPayment(subscriber, subscription)
|
||||
if (activeInAppPayment == null) {
|
||||
warn(type, "Failed to generate active in-app payment. Exiting")
|
||||
@@ -235,6 +235,8 @@ class InAppPaymentKeepAliveJob private constructor(
|
||||
* fail the job and let the keep-alive check create a new one as necessary.
|
||||
*/
|
||||
private fun clearOldPendingPaymentsIfRequired() {
|
||||
info(type, "Clearing out old pending payments as required.")
|
||||
|
||||
val inAppPayments = SignalDatabase.inAppPayments.getOldPendingPayments(type.inAppPaymentType)
|
||||
|
||||
inAppPayments.forEach { inAppPayment ->
|
||||
|
||||
Reference in New Issue
Block a user