Process notification profiles before accounts during storage sync.

This commit is contained in:
Michelle Tang
2025-10-08 11:59:48 -04:00
committed by Alex Hart
parent a14517fceb
commit 6e8f982e7b
2 changed files with 4 additions and 5 deletions

View File

@@ -464,11 +464,11 @@ class StorageSyncJob private constructor(parameters: Parameters, private var loc
ContactRecordProcessor().process(records.contacts, StorageSyncHelper.KEY_GENERATOR)
GroupV1RecordProcessor().process(records.gv1, StorageSyncHelper.KEY_GENERATOR)
GroupV2RecordProcessor().process(records.gv2, StorageSyncHelper.KEY_GENERATOR)
NotificationProfileRecordProcessor().process(records.notificationProfileRecords, StorageSyncHelper.KEY_GENERATOR)
AccountRecordProcessor(context, freshSelf()).process(records.account, StorageSyncHelper.KEY_GENERATOR)
StoryDistributionListRecordProcessor().process(records.storyDistributionLists, StorageSyncHelper.KEY_GENERATOR)
CallLinkRecordProcessor().process(records.callLinkRecords, StorageSyncHelper.KEY_GENERATOR)
ChatFolderRecordProcessor().process(records.chatFolderRecords, StorageSyncHelper.KEY_GENERATOR)
NotificationProfileRecordProcessor().process(records.notificationProfileRecords, StorageSyncHelper.KEY_GENERATOR)
}
private fun getAllLocalStorageIds(self: Recipient): List<StorageId> {

View File

@@ -310,13 +310,12 @@ object StorageSyncHelper {
val localProfile = SignalDatabase.notificationProfiles.getProfile(query)
if (localProfile == null) {
Log.w(TAG, "Unable to find local notification profile with given remote id")
Log.w(TAG, "Unable to find local notification profile with given remote id $remoteId")
} else {
val disabledAt = System.currentTimeMillis()
Log.i(TAG, "Setting manually enabled profile to ${localProfile.id} ending at $remoteEndTime. Disabled at: $disabledAt")
Log.i(TAG, "Setting manually enabled profile to ${localProfile.id} ending at $remoteEndTime.")
SignalStore.notificationProfile.manuallyEnabledProfile = localProfile.id
SignalStore.notificationProfile.manuallyEnabledUntil = remoteEndTime
SignalStore.notificationProfile.manuallyDisabledAt = disabledAt
SignalStore.notificationProfile.manuallyDisabledAt = 0L
}
}
} else if (update.new.proto.notificationProfileManualOverride!!.disabledAtTimestampMs != null) {