Skip to content

[enhancement]: Show system updates less often (unable to clear packageUpdate notification) #2864

Closed
@klein0r

Description

@klein0r

No existing issues.

  • There is no existing issue for my request.

Description

At the moment, every getRepository or upgradeOsPackages host message leads to a new notification:

try {
await listUpdatableOsPackages();
} catch (e) {
logger.warn(`${hostLogPrefix} Could not check for new OS updates: ${e.message}`);
}

try {
await listUpdatableOsPackages();
} catch (e) {
logger.warn(`${hostLogPrefix} Could not check for new OS updates after upgrade: ${e.message}`);
}

const packages = await packManager.listUpgradeablePackages();
if (!packages.length) {
await notificationHandler.clearNotifications('system', 'packageUpdates', `system.host.${hostname}`);
return;
}
await notificationHandler.addMessage('system', 'packageUpdates', packages.join('\n'), `system.host.${hostname}`);
await states!.setState(`${hostObjectPrefix}.osPackageUpdates`, { val: JSON.stringify(packages), ack: true });

So there's a new notification every day (if the repo has changed) - even if the notification has been confirmed already.

Why?

I'm doing updates about once a week. So I cannot remove that notification for a few days. When using admin 7.0.23 it is not possible to remove those notifications:

asd

Looks like the notifications are cleared correctly (system.host.iobroker.notifications.system is {} afterwards) but a page reload re-generates the notification: {"packageUpdates":{"count":1}}

[3,70,"sendToHost",["system.host.iobroker","clearNotifications",{"category":"packageUpdates"}]]	1723533804.2533119

How?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions