That's because the apps they use are outdated and don't follow Google's Android standards. Instead of updating their apps to utilize Bundled Notifications properly, they still use the old way of posting isolated notifications, and then MIUI "forces" them to be grouped, while apps that properly utilize Bundled Notifications are being destroyed by MIUI. It's not anybody's fault but Xiaomi's, that their developers are not competent enough to follow Android standards.
After some tinkering, I managed to "patch" the double icon issue, but still looking into the "auto dismissal" of those bundled notifications.
This one is still a mystery...
Code:
# An updated GroupSummary notification to replace the old one
StatusBar: onNotificationPosted: (Key: 0|com.google.android.gm|505426166| ...)
StatusBar: GroupChild: false IsGroupSummary: true IsUpdate: true hasIcon: true
PhoneStatusBar: updateNotification pkg=com.google.android.gm;id=505426166
# The new GroupChild notification that was received
StatusBar: onNotificationPosted: Key: 0|com.google.android.gm|-150427634| ...
StatusBar: GroupChild: true IsGroupSummary: false IsUpdate: true hasIcon: true
PhoneStatusBar: updateNotification pkg=com.google.android.gm;id=-150427634
# Unexpected dismissal of all notifications related to that app
StatusBar: onNotificationRemoved: Key: 0|com.google.android.gm|505426166|null|10124
StatusBar: onNotificationRemoved: Key: 0|com.google.android.gm|-150427634|null|10124
StatusBar: removeNotificationViews(key=android.os.Binder@9431b55)
PhoneStatusBar: removeNotification key=android.os.Binder@9431b55 keyCode=155392853 ...
PhoneStatusBar: removeNotificationKeyguard keyCode=155392853;pkg=com.google.android.gm
StatusBar: removeNotificationViews(key=android.os.Binder@10b804c)
PhoneStatusBar: removeNotification key=android.os.Binder@10b804c keyCode=17530956 ...
PhoneStatusBar: removeNotificationKeyguard keyCode=17530956;pkg=com.google.android.gm