Add more logging around notification profile overrides.

This commit is contained in:
Michelle Tang
2025-09-15 18:15:42 -04:00
committed by Greyson Parrelli
parent 7235a3730c
commit 862bab55af
2 changed files with 5 additions and 3 deletions

View File

@@ -42,7 +42,6 @@ object NotificationProfiles {
}
if (shouldClearManualOverride(manualProfile, scheduledProfile)) {
Log.i(TAG, "Clearing manual override")
SignalExecutors.UNBOUNDED.execute {
SignalDatabase.recipients.markNeedsSync(Recipient.self().id)
StorageSyncHelper.scheduleSyncForDataChange()
@@ -61,12 +60,14 @@ object NotificationProfiles {
var shouldScheduleSync = false
if (manualProfile == null && storeValues.manuallyEnabledProfile != 0L) {
Log.i(TAG, "Clearing override: ${storeValues.manuallyEnabledProfile} and ${storeValues.manuallyEnabledUntil}")
storeValues.manuallyEnabledProfile = 0
storeValues.manuallyEnabledUntil = 0
shouldScheduleSync = true
}
if (scheduledProfile != null && storeValues.manuallyDisabledAt != 0L) {
Log.i(TAG, "Clearing override: ${storeValues.manuallyDisabledAt}")
storeValues.manuallyDisabledAt = 0
shouldScheduleSync = true
}

View File

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