Group summary left behind when a tagged notification is re-sent without a group
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #7744 by @Olaoluwa99 — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read app/src/main/kotlin/io/homeassistant/companion/android/notifications/MessagingManager.kt around lines 1059–1064, then trace where the summary tag is posted and cancelGroupIfNeeded is called. Check the corresponding code in wear/.../MessagingManager.kt as the issue reports the same line there. Reproduce the grouped notification replacement from the issue and verify that both paths remove the empty summary while preserving notifications in groups that still have children.
Written by the indexing model from the issue text.
Description
Home Assistant Android app version(s): 2026.8.4-full (24228)
Android version(s): 14 (OxygenOS 14)
Device model(s): OnePlus 8T (KB2005)
Home Assistant version: 2026.10.4
Last working Home Assistant release (if known): unknown
Description of problem, include YAML if issue is related to notifications:
When a notification that was posted with a group is replaced (same tag) by a
notification without a group, the old group summary stays in the shade as an empty
entry — only "Home Assistant • ", no title or text.
Steps:
action: notify.mobile_app_kb2005
data:
title: Test
message: First, in a group
data:
tag: test-tag
group: test-group
then
action: notify.mobile_app_kb2005
data:
title: Test
message: Second, same tag, no group
data:
tag: test-tag
Result: the second notification replaces the first one and leaves the group, but the
test-group summary remains, empty. Expected: the summary is removed, since the group no
longer has children.
The app already tries to handle exactly this case, but looks the summary up under the
wrong tag. In MessagingManager.kt
(L1059-L1064):
val notification = notificationManagerCompat.getActiveNotification(tag, messageId)
if (notification != null && notification.isGroup) {
previousGroup = NotificationData.GROUP_PREFIX + notification.tag
previousGroupId = previousGroup.hashCode()
}
notification.tag is the notification's own tag (test-tag), so previousGroup becomes
group_test-tag. The summary, however, is posted with tag group_test-group
(L1136),
so cancelGroupIfNeeded(previousGroup, previousGroupId)
(L1142)
finds no matching active notification and does nothing.
Suggested fix — take the group of the previous notification (it already carries the
group_ prefix, and is null for system auto-groups):
val notification = notificationManagerCompat.getActiveNotification(tag, messageId)
val previous = notification?.notification?.group
if (notification != null && notification.isGroup && !previous.isNullOrBlank()) {
previousGroup = previous
previousGroupId = previousGroup.hashCode()
}
With the right tag, cancelGroupIfNeeded should then remove the summary: by that point
the child has already been re-posted without the group, so the summary is the only
notification left in it.
Workarounds: keep the same group on the replacement, or send clear_notification with
tag: group_<group name> (that removes the orphaned summary).
Related: #4453 — a different case (same tag moved from group1 to group2), where the
app makes no attempt to clean up; here the cleanup code exists but uses the wrong key.
Companion App Logs:
Not collected — the cause is visible in the code above. Happy to provide them if needed.
Screenshot or video of problem:
Additional information:
The Wear OS app has the same line:
wear/.../MessagingManager.kt#L128.
- Dominant language
- Kotlin
- Stars
- 4k
- Forks
- 1.1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 115
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from home-assistant/android
-
e2e-failure
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/android#7809 ·
Maintainers usually reply within 1 day
-
bug sensor-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
home-assistant/android#7803 · 3 comments ·
Maintainers usually reply within 1 day
-
Last notification sensor reports Android's new auto-group summary (`g:Aggregate_…`) instead of the actual notificationPossibly taken @chiva claimed this 3 days ago. Openbug sensor-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/android#7671 · 2 comments ·
Maintainers usually reply within 1 day
-
With 100 or more geofences, the app re-registers them on every sensor pass and android.zone_entered repeatsPossibly taken A pull request linked to this issue is open or already merged. Openbug location-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
home-assistant/android#7561 ·
Maintainers usually reply within 1 day
-
Assist bug
Difficulty 3/5 1-2 days Newbie friendliness 57/100
home-assistant/android#7802 · 2 comments ·
Maintainers usually reply within 1 day
All issues in home-assistant/android
Similar issues
-
index-request triaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
JetBrains/klibs-io#611 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
afk-ok area:ci size:S
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
enorm-labs/event-junkie#4518 ·
Maintainers usually reply within 1 day
-
android:player
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day