Improve handling of unknown IDs in storage service.

This commit is contained in:
Greyson Parrelli
2022-04-04 09:54:50 -04:00
committed by Cody Henthorne
parent e2c54eef77
commit b34ca8ca2f
7 changed files with 139 additions and 77 deletions

View File

@@ -33,6 +33,7 @@ import org.thoughtcrime.securesms.jobs.StorageForcePushJob
import org.thoughtcrime.securesms.jobs.SubscriptionReceiptRequestResponseJob
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.thoughtcrime.securesms.payments.DataExportUtil
import org.thoughtcrime.securesms.storage.StorageSyncHelper
import org.thoughtcrime.securesms.util.ConversationUtil
import org.thoughtcrime.securesms.util.FeatureFlags
import java.util.Optional
@@ -136,11 +137,19 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
}
)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_sync_now),
summary = DSLSettingsText.from(R.string.preferences__internal_sync_now_description),
onClick = {
enqueueStorageServiceSync()
}
)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_force_storage_service_sync),
summary = DSLSettingsText.from(R.string.preferences__internal_force_storage_service_sync_description),
onClick = {
forceStorageServiceSync()
enqueueStorageServiceForcePush()
}
)
@@ -475,7 +484,12 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
}
}
private fun forceStorageServiceSync() {
private fun enqueueStorageServiceSync() {
StorageSyncHelper.scheduleSyncForDataChange()
Toast.makeText(context, "Scheduled routine storage sync", Toast.LENGTH_SHORT).show()
}
private fun enqueueStorageServiceForcePush() {
ApplicationDependencies.getJobManager().add(StorageForcePushJob())
Toast.makeText(context, "Scheduled storage force push", Toast.LENGTH_SHORT).show()
}