Always include ourselves in optimistic profile fetches.

master
Greyson Parrelli 2020-09-23 09:40:43 -04:00
parent f182be2d79
commit f2b10c0ba8
2 changed files with 3 additions and 1 deletions

View File

@ -137,7 +137,6 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
NotificationChannels.create(this);
RefreshPreKeysJob.scheduleIfNecessary();
StorageSyncHelper.scheduleRoutineSync();
RetrieveProfileJob.enqueueRoutineFetchIfNecessary(this);
RegistrationUtil.maybeMarkRegistrationComplete(this);
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
@ -155,6 +154,7 @@ public class ApplicationContext extends MultiDexApplication implements DefaultLi
Log.i(TAG, "App is now visible.");
FeatureFlags.refreshIfNecessary();
ApplicationDependencies.getRecipientCache().warmUp();
RetrieveProfileJob.enqueueRoutineFetchIfNecessary(this);
executePendingContactSync();
KeyCachingService.onAppForegrounded(this);
ApplicationDependencies.getFrameRateTracker().begin();

View File

@ -181,6 +181,8 @@ public class RetrieveProfileJob extends BaseJob {
current - TimeUnit.DAYS.toMillis(1),
50);
ids.add(Recipient.self().getId());
if (ids.size() > 0) {
Log.i(TAG, "Optimistically refreshing " + ids.size() + " eligible recipient(s).");
enqueue(new HashSet<>(ids));