Fix post-transfer emoji search.

This commit is contained in:
Michelle Tang
2024-12-06 17:27:23 -05:00
committed by Greyson Parrelli
parent a577018d03
commit a188eb64ab
3 changed files with 16 additions and 1 deletions

View File

@@ -162,9 +162,10 @@ public class ApplicationMigrations {
static final int WALLPAPER_MIGRATION_CLEANUP = 118;
static final int AEP_INTRODUCTION = 119;
static final int GROUP_EXTRAS_DB_FIX = 120;
static final int EMOJI_SEARCH_INDEX_CHECK_2 = 121;
}
public static final int CURRENT_VERSION = 120;
public static final int CURRENT_VERSION = 121;
/**
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
@@ -743,6 +744,10 @@ public class ApplicationMigrations {
jobs.put(Version.GROUP_EXTRAS_DB_FIX, new DatabaseMigrationJob());
}
if (lastSeenVersion < Version.EMOJI_SEARCH_INDEX_CHECK_2) {
jobs.put(Version.EMOJI_SEARCH_INDEX_CHECK_2, new EmojiSearchIndexCheckMigrationJob());
}
return jobs;
}

View File

@@ -8,6 +8,7 @@ package org.thoughtcrime.securesms.registration.util;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.dependencies.AppDependencies;
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
import org.thoughtcrime.securesms.jobs.EmojiSearchIndexDownloadJob;
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob;
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
import org.thoughtcrime.securesms.keyvalue.PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode;
@@ -48,6 +49,9 @@ public final class RegistrationUtil {
.then(new DirectoryRefreshJob(false))
.enqueue();
SignalStore.emoji().clearSearchIndexMetadata();
EmojiSearchIndexDownloadJob.scheduleImmediately();
} else if (!SignalStore.registration().isRegistrationComplete()) {
Log.i(TAG, "Registration is not yet complete.", new Throwable());
}