Skip to content

Fix scheduled Note To Self messages delivering without notifications …#14819

Open
terrancekhuang wants to merge 1 commit into
signalapp:mainfrom
terrancekhuang:scheduled-note-to-self-notifications
Open

Fix scheduled Note To Self messages delivering without notifications …#14819
terrancekhuang wants to merge 1 commit into
signalapp:mainfrom
terrancekhuang:scheduled-note-to-self-notifications

Conversation

@terrancekhuang
Copy link
Copy Markdown

…or preview update

First time contributor checklist

Contributor checklist

  • Samsung Galaxy S25 Ultra (SM-S938U), Android 16 (One UI 8.5)
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

Fixes #13352

Fix 1: Conversation list preview not updated
IndividualSendJob and IndividualSendJobV2 called ThreadTable.updateSilently() after marking a scheduled message as sent. updateSilently skips notifyConversationListListeners(), so the UI never refreshes. Fixed by switching to ThreadTable.update().

Fix 2: No notification
Three layers of filtering combined to suppress the notification:

  1. getMessagesForNotificationState only fetches messages with READ = 0. Outgoing messages (including Note To Self sends) are stored with READ = 1, so they are never queried.
  2. NotificationMessage.isUnreadIncoming excludes all outgoing messages, so even if fetched they would be dropped from notification state.
  3. NotificationFactory.shouldAlert() suppressed all notifications where authorRecipient.isSelf.

Fix: when ScheduledMessageManager fires a scheduled Note To Self message, it sets READ = 0 on that message via a new MessageTable.markAsUnread() helper. A new isNoteToSelfScheduled flag in NotificationStateProvider includes outgoing unread messages in Note To Self threads. shouldAlert() is updated to allow alerts for Note To Self conversations specifically (group conversations where you are the last sender remain unaffected). Finally, IndividualSendJob and IndividualSendJobV2 call MessageNotifier.updateNotification() after completing a Note To Self send to trigger the notification at the right moment.

Testing

  1. Scheduled a message in Note To Self with the app in the background - notification fired correctly.
  2. Scheduled a message and remained in the app in conversations list - conversation list preview updated immediately with an unread badge (no popup notification, which is expected foreground behavior).
  3. Sent a regular (non-scheduled) Note To Self message - no notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduled messages for "Note To Self" arrive without notifications

1 participant