Always clear LevelUpdateOperation if an error occurs.

After speaking with the server team, it's been made clear that the
idempotency key should only ever be reutilized if we never heard
back from the server. Since we do not employ an automatic retry
mechanism for setting a user's subscription level (we simply
notify the user of the failure) it is less error-prone to simply
never reuse an idempotency key.
This commit is contained in:
Alex Hart 2021-11-01 09:45:31 -03:00 committed by Greyson Parrelli
parent b0788f7307
commit b8cf0cc1be

View file

@ -168,6 +168,7 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
}
}
}.doOnError {
SignalStore.donationsValues().clearLevelOperation()
LevelUpdate.updateProcessingState(false)
}.subscribeOn(Schedulers.io())
}