(Bug?) Missing notifications with same ID in Active Notification Count sensor

Usually Uber Eats Android app has 3 notifications in order: PreparingReadyRate.

It looks like Uber Eats app tries to reuse the same notification ID but the previous notifications are still there.
As the result, the attribute list in sensor.my_phone_active_notification_count can only see the oldest notification.

For the Uber Eats case, only Preparing order notification can be found in HA.
When I dismiss Preparing order notification, I can see Order is ready notification.
When I dismiss Order is ready notification, I can see Rate the experience notification.

Is it a known issue for HA Companion app in Android?
In my opinion, HA should add all 3 notifications to Active Notification Count sensor or at least select the latest notifications with the same ID.
Thanks!

Can’t help, but this thread seems to be related Last Notification sensor w/ consecutive notifications on Android

Maybe have a read through that and see if it solves, or at least explains, your issue?

Thanks for the reply.
Looks like that thread is about Last Notification sensor but I have been using Active Notification Count sensor.

The app is not reusing the same notification ID. It is using whatever notification ID was given to the app in the list of notifications.

“The app” means the “Uber Eats” app.
Sorry for the confusion and edited the original post.

I don’t understand Kotlin much.
I feel like post_time should be included to the key or check whether greater than existing post_time before inserting.

If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.

if the notification has the same ID then you will only see 1 notification as it will be replaced. Active notifications are not considered canceled.

Post a notification to be shown in the status bar. If a notification with the same id has already been posted by your application and has not yet been canceled, it will be replaced by the updated information.

https://developer.android.com/reference/android/app/NotificationManager#notify(int,%20android.app.Notification)

https://developer.android.com/reference/android/service/notification/StatusBarNotification#getId()

It looks like active notification count can detect all 3 notifications.
However, they are aggregated then and no details can be found in attributes.