Mark unexpected cancellation when silenced so we do not keep hammering the logs.

main
Alex Hart 2022-11-04 09:41:30 -03:00 zatwierdzone przez Cody Henthorne
rodzic b8e16353ab
commit f6f1fdb87d
3 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -58,7 +58,7 @@ class DonorErrorConfigurationFragment : DSLSettingsFragment() {
secondaryButtonNoOutline( secondaryButtonNoOutline(
text = DSLSettingsText.from(R.string.preferences__internal_donor_error_clear), text = DSLSettingsText.from(R.string.preferences__internal_donor_error_clear),
onClick = { onClick = {
lifecycleDisposable += viewModel.clear().subscribe() lifecycleDisposable += viewModel.clearErrorState().subscribe()
} }
) )
} }

Wyświetl plik

@ -108,10 +108,10 @@ class DonorErrorConfigurationViewModel : ViewModel() {
} }
}.subscribeOn(Schedulers.io()) }.subscribeOn(Schedulers.io())
return clear().andThen(saveState) return clearErrorState().andThen(saveState)
} }
fun clear(): Completable { fun clearErrorState(): Completable {
return Completable.fromAction { return Completable.fromAction {
synchronized(SubscriptionReceiptRequestResponseJob.MUTEX) { synchronized(SubscriptionReceiptRequestResponseJob.MUTEX) {
SignalStore.donationsValues().setExpiredBadge(null) SignalStore.donationsValues().setExpiredBadge(null)

Wyświetl plik

@ -408,8 +408,10 @@ public class ConversationListFragment extends MainFragment implements ActionMode
isDisplayingSubscriptionFailure = true; isDisplayingSubscriptionFailure = true;
} else if (unexpectedSubscriptionCancellation != null && SignalStore.donationsValues().isUserManuallyCancelled()) { } else if (unexpectedSubscriptionCancellation != null && SignalStore.donationsValues().isUserManuallyCancelled()) {
Log.w(TAG, "Unexpected cancellation detected but not displaying dialog because user manually cancelled their subscription: " + unexpectedSubscriptionCancellation, true); Log.w(TAG, "Unexpected cancellation detected but not displaying dialog because user manually cancelled their subscription: " + unexpectedSubscriptionCancellation, true);
SignalStore.donationsValues().setUnexpectedSubscriptionCancelationWatermark(subscriptionFailureTimestamp);
} else if (unexpectedSubscriptionCancellation != null && !SignalStore.donationsValues().showCantProcessDialog()) { } else if (unexpectedSubscriptionCancellation != null && !SignalStore.donationsValues().showCantProcessDialog()) {
Log.w(TAG, "Unexpected cancellation detected but not displaying dialog because user has silenced it.", true); Log.w(TAG, "Unexpected cancellation detected but not displaying dialog because user has silenced it.", true);
SignalStore.donationsValues().setUnexpectedSubscriptionCancelationWatermark(subscriptionFailureTimestamp);
} }
if (expiredBadge != null && !isDisplayingSubscriptionFailure) { if (expiredBadge != null && !isDisplayingSubscriptionFailure) {