Add retry when user resubscribes after canceling.

This commit is contained in:
Alex Hart
2022-04-28 14:33:30 -03:00
parent a6f1e0e972
commit 33236ea8e6
2 changed files with 7 additions and 1 deletions

View File

@@ -161,6 +161,9 @@ public class SubscriptionReceiptRequestResponseJob extends BaseJob {
Log.w(TAG, "Subscription is not yet active. Status: " + subscription.getStatus(), true);
throw new RetryableException();
} else if (subscription.isCanceled()) {
Log.w(TAG, "Subscription is marked as cancelled, but it's possible that the user cancelled and then later tried to resubscribe. Scheduling a retry.", true);
throw new RetryableException();
} else {
Log.i(TAG, "Recording end of period from active subscription: " + subscription.getStatus(), true);
SignalStore.donationsValues().setLastEndOfPeriod(subscription.getEndOfCurrentPeriod());