kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add retry when user resubscribes after canceling.
rodzic
a6f1e0e972
commit
33236ea8e6
|
@ -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());
|
||||
|
|
|
@ -57,7 +57,6 @@ public final class ActiveSubscription {
|
|||
private static final Set<Status> FAILURE_STATUSES = new HashSet<>(Arrays.asList(
|
||||
INCOMPLETE_EXPIRED,
|
||||
PAST_DUE,
|
||||
CANCELED,
|
||||
UNPAID
|
||||
));
|
||||
|
||||
|
@ -197,6 +196,10 @@ public final class ActiveSubscription {
|
|||
return Status.isPaymentFailed(getStatus());
|
||||
}
|
||||
|
||||
public boolean isCanceled() {
|
||||
return Status.getStatus(getStatus()) == Status.CANCELED;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
|
Ładowanie…
Reference in New Issue