When several chats have pending notifications, ONE new message makes Android show heads-up banners for OTHER chats that received nothing. Reading one chat does the same.
MEASURED (adb, reproduced on demand with two bots)
One new message -> 2 banners: the receiving chat plus an unrelated one. Reading one chat -> 2 banners, both unrelated.
All banners were group CHILD notifications (isSummary=false).
showExtraNotifications() re-publishes the whole stack on every change: 8 notifications in 0.083 s. Re-posts keep the same mCreationTimeMs: updates, not re-creations.
No notification carries FLAG_ONLY_ALERT_ONCE; setOnlyAlertOnce never appears in NotificationsController.java.
WHY IT IS APP-SIDE
Children already carry GROUP_ALERT_SUMMARY (NotificationsController.java:5618), so the alerting notification is the group summary. SystemUI transfers its heads-up to a child (HeadsUpCoordinator.findBestTransferChild). Repetition is gated by shouldHunAgain(): !entry.hasInterrupted() || (flags and FLAG_ONLY_ALERT_ONCE) == 0. Without the flag this is always true, so every re-post re-alerts on stock Android too - one banner there, one per chat on ColorOS, which also ignores GROUP_ALERT_SUMMARY for children.
SUGGESTED FIX
Set FLAG_ONLY_ALERT_ONCE on the group summary when the rebuild is not caused by a new incoming message (read/dismiss/refresh), and leave it off when a message actually arrives.
ALSO
While 2+ chats are pending, per-chat notifications move to the internal Other channel, so users cannot suppress repeats per chat; blocking it is auto-reverted by checkOtherNotificationsChannel().
repeat_messages defaults to 60 min, so from 11:00 to 22:00 the whole stack re-posts and re-alerts hourly while one personal message stays unread.
Steps to reproduce
On Android, keep notifications for private chats enabled (default).
Receive messages in 4-5 different chats and leave them all unread, so several Telegram notifications are pending at the same time. Two or more is enough: grouping (useSummaryNotification) turns on from two chats.
Leave the phone unlocked on the home screen and wait for ONE new message to arrive in one of those chats.
Observe: a heads-up banner appears for the chat that received the message AND for at least one other chat that received nothing new.
Now open Telegram and read one of the pending chats.
Observe: heads-up banners appear again for the remaining chats, showing old content that has not changed.
With only one pending chat the bug does not happen - grouping is not used, and the notification behaves normally.
No heads-up banners with 2+ chats on ColorOS Devices: Oppo Find X9 Pro, X9 Ultra, Find N6, all firmware from ColorOS 16 to 17 (e.g. CPH2765_17.0.0.101). Telegram 13.1.1 (7237). Oppo has been notified, no reply yet. This looks like an incompatibility, not a bug in either side.
Cause: with 2+ chats, the summary alerts (GROUP_ALERT_ALL) and children move to "Internal notifications" (importance 3, GROUP_ALERT_SUMMARY). ColorOS shows no heads-up for a group summary, and children can't show one at importance 3.
Fix (patch attached): GROUP_ALERT_CHILDREN, so the new message's child alerts in its own chat channel. Other children keep their channel with setOnlyAlertOnce(true). The summary uses the loudest child's channel. Tested on Find N6; video of my build attached.
Downside of my self-signed build: Firebase issues no FCM token, so Keep-Alive Service and Background Connection must stay on.
Unchanged: silent messages move a chat to the importance 2 "Silent" channel, which ColorOS hides from the lock screen until the next normal message. Groups stay limited to 2 alerts per 3 minutes.
I rebuilt the client from my PR (DrKLO/Telegram#2251) and tested it again on the same device (Oppo Find N6, ColorOS 17). Banners work correctly with this build: each new message shows one heads-up banner from the right chat, with one sound. The latest beta still shows no banners from the second chat on. Video attached.
I’ll now go through the beta again and debug it, and will report back within a few hours.
I debugged beta 13.2.0 (7287) on Find N6 (ColorOS 17). It seems to include only part of PR DrKLO/Telegram#2251. dumpsys notification with 2 chats:
- Children are still in Other3 (importance 3), with groupAlertBehavior=SUMMARY. - The summary is groupAlertBehavior=ALL, in the last chat’s channel, so it plays the sound. - ONLY_ALERT_ONCE is set correctly on old children, so that part works.
Result: of 6 messages, only the first (single chat, importance 4) showed a heads-up. ColorOS shows none for a summary, and children can’t at importance 3.
Still missing from the PR: 1. The new message’s child stays in its own chat channel, with GROUP_ALERT_CHILDREN. 2. The summary uses GROUP_ALERT_CHILDREN. 3. Other children keep their current channel. 4. The summary uses the loudest child’s channel, not Silent.
Note: my PR build was tested with Keep-Alive and Background Connection, as self-signed builds get no FCM token, so please verify the FCM path with the full patch.
Devices: Oppo Find X9 Pro, X9 Ultra, Find N6, all firmware from ColorOS 16 to 17 (e.g. CPH2765_17.0.0.101). Telegram 13.1.1 (7237). Oppo has been notified, no reply yet. This looks like an incompatibility, not a bug in either side.
Cause: with 2+ chats, the summary alerts (GROUP_ALERT_ALL) and children move to "Internal notifications" (importance 3, GROUP_ALERT_SUMMARY). ColorOS shows no heads-up for a group summary, and children can't show one at importance 3.
Fix (patch attached): GROUP_ALERT_CHILDREN, so the new message's child alerts in its own chat channel. Other children keep their channel with setOnlyAlertOnce(true). The summary uses the loudest child's channel. Tested on Find N6; video of my build attached.
Downside of my self-signed build: Firebase issues no FCM token, so Keep-Alive Service and Background Connection must stay on.
Unchanged: silent messages move a chat to the importance 2 "Silent" channel, which ColorOS hides from the lock screen until the next normal message. Groups stay limited to 2 alerts per 3 minutes.
I'm debugging it right now
I’ll now go through the beta again and debug it, and will report back within a few hours.
dumpsys notification with 2 chats:
- Children are still in Other3 (importance 3), with groupAlertBehavior=SUMMARY.
- The summary is groupAlertBehavior=ALL, in the last chat’s channel, so it plays the sound.
- ONLY_ALERT_ONCE is set correctly on old children, so that part works.
Result: of 6 messages, only the first (single chat, importance 4) showed a heads-up. ColorOS shows none for a summary, and children can’t at importance 3.
Still missing from the PR:
1. The new message’s child stays in its own chat channel, with GROUP_ALERT_CHILDREN.
2. The summary uses GROUP_ALERT_CHILDREN.
3. Other children keep their current channel.
4. The summary uses the loudest child’s channel, not Silent.
Note: my PR build was tested with Keep-Alive and Background Connection, as self-signed builds get no FCM token, so please verify the FCM path with the full patch.