From 862bab55af3fdd18c26c60fcbcb0ff7b7c43e831 Mon Sep 17 00:00:00 2001 From: Michelle Tang Date: Mon, 15 Sep 2025 18:15:42 -0400 Subject: [PATCH] Add more logging around notification profile overrides. --- .../securesms/notifications/profiles/NotificationProfiles.kt | 3 ++- .../org/thoughtcrime/securesms/storage/StorageSyncHelper.kt | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt index 498dc6122e..e6d782bd4f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt @@ -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 } diff --git a/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncHelper.kt b/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncHelper.kt index 44cdc842d0..2164b0d493 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncHelper.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/storage/StorageSyncHelper.kt @@ -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) {