Enqueue profile refresh sync after badge redemption.

fork-5.53.8
Alex Hart 2022-05-16 09:52:23 -03:00 zatwierdzone przez Cody Henthorne
rodzic 25788ef751
commit 2d57cb4ed0
3 zmienionych plików z 17 dodań i 11 usunięć

Wyświetl plik

@ -72,14 +72,16 @@ public class BoostReceiptRequestResponseJob extends BaseJob {
} }
public static JobManager.Chain createJobChainForBoost(@NonNull StripeApi.PaymentIntent paymentIntent) { public static JobManager.Chain createJobChainForBoost(@NonNull StripeApi.PaymentIntent paymentIntent) {
BoostReceiptRequestResponseJob requestReceiptJob = createJob(paymentIntent, DonationErrorSource.BOOST, Long.parseLong(SubscriptionLevels.BOOST_LEVEL)); BoostReceiptRequestResponseJob requestReceiptJob = createJob(paymentIntent, DonationErrorSource.BOOST, Long.parseLong(SubscriptionLevels.BOOST_LEVEL));
DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForBoost(); DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForBoost();
RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forBoost(); RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forBoost();
MultiDeviceProfileContentUpdateJob multiDeviceProfileContentUpdateJob = new MultiDeviceProfileContentUpdateJob();
return ApplicationDependencies.getJobManager() return ApplicationDependencies.getJobManager()
.startChain(requestReceiptJob) .startChain(requestReceiptJob)
.then(redeemReceiptJob) .then(redeemReceiptJob)
.then(refreshOwnProfileJob); .then(refreshOwnProfileJob)
.then(multiDeviceProfileContentUpdateJob);
} }
public static JobManager.Chain createJobChainForGift(@NonNull StripeApi.PaymentIntent paymentIntent, public static JobManager.Chain createJobChainForGift(@NonNull StripeApi.PaymentIntent paymentIntent,

Wyświetl plik

@ -89,11 +89,13 @@ public class DonationReceiptRedemptionJob extends BaseJob {
.setLifespan(TimeUnit.DAYS.toMillis(1)) .setLifespan(TimeUnit.DAYS.toMillis(1))
.build()); .build());
RefreshOwnProfileJob refreshOwnProfileJob = new RefreshOwnProfileJob(); RefreshOwnProfileJob refreshOwnProfileJob = new RefreshOwnProfileJob();
MultiDeviceProfileContentUpdateJob multiDeviceProfileContentUpdateJob = new MultiDeviceProfileContentUpdateJob();
return ApplicationDependencies.getJobManager() return ApplicationDependencies.getJobManager()
.startChain(redeemReceiptJob) .startChain(redeemReceiptJob)
.then(refreshOwnProfileJob); .then(refreshOwnProfileJob)
.then(multiDeviceProfileContentUpdateJob);
} }
private DonationReceiptRedemptionJob(long giftMessageId, boolean primary, @NonNull DonationErrorSource errorSource, @NonNull Job.Parameters parameters) { private DonationReceiptRedemptionJob(long giftMessageId, boolean primary, @NonNull DonationErrorSource errorSource, @NonNull Job.Parameters parameters) {

Wyświetl plik

@ -90,15 +90,17 @@ public class SubscriptionReceiptRequestResponseJob extends BaseJob {
} }
public static JobManager.Chain createSubscriptionContinuationJobChain(boolean isForKeepAlive) { public static JobManager.Chain createSubscriptionContinuationJobChain(boolean isForKeepAlive) {
Subscriber subscriber = SignalStore.donationsValues().requireSubscriber(); Subscriber subscriber = SignalStore.donationsValues().requireSubscriber();
SubscriptionReceiptRequestResponseJob requestReceiptJob = createJob(subscriber.getSubscriberId(), isForKeepAlive); SubscriptionReceiptRequestResponseJob requestReceiptJob = createJob(subscriber.getSubscriberId(), isForKeepAlive);
DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForSubscription(requestReceiptJob.getErrorSource()); DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForSubscription(requestReceiptJob.getErrorSource());
RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forSubscription(); RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forSubscription();
MultiDeviceProfileContentUpdateJob multiDeviceProfileContentUpdateJob = new MultiDeviceProfileContentUpdateJob();
return ApplicationDependencies.getJobManager() return ApplicationDependencies.getJobManager()
.startChain(requestReceiptJob) .startChain(requestReceiptJob)
.then(redeemReceiptJob) .then(redeemReceiptJob)
.then(refreshOwnProfileJob); .then(refreshOwnProfileJob)
.then(multiDeviceProfileContentUpdateJob);
} }
private SubscriptionReceiptRequestResponseJob(@NonNull Parameters parameters, private SubscriptionReceiptRequestResponseJob(@NonNull Parameters parameters,