Commit 17f1834e authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Notifications] Spawn new notification if one to replace doesn't exist

Since the Notification Server knows nothing about what notifications were sent, it tells us a notification was replaced and
uses the ID supplied by the application. Only in the model we then realize it didn't exist.
This means we will potentially reuse the notification ID sent by the application as we just increment a counter.
However, in practice I haven't encountered this issue before (maybe we just never noticed?) but I think this is an
acceptable workaround.

BUG: 407881
FIXED-IN: 5.16.0

Differential Revision: https://phabricator.kde.org/D21474
parent 5c83d292
......@@ -108,6 +108,8 @@ void NotificationsModel::Private::onNotificationReplaced(uint replacedId, const
const int row = rowOfNotification(replacedId);
if (row == -1) {
qCWarning(NOTIFICATIONMANAGER) << "Trying to replace notification with id" << replacedId << "which doesn't exist, creating a new one. This is an application bug!";
onNotificationAdded(notification);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment