From fa287bb961a9580d614ee13f0108dbe75e8f505b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 07:03:11 +0000 Subject: [PATCH 1/3] Initial plan From b84f9f94e1981cd09c59ee322c72b62c473dbbf6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 07:10:01 +0000 Subject: [PATCH 2/3] Add resolved notifications for package updates Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> --- .../installer/src/calls/packageInstall.ts | 4 ++- packages/installer/src/installer/index.ts | 1 + .../sendPackageInstallResolvedNotification.ts | 34 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 packages/installer/src/installer/sendPackageInstallResolvedNotification.ts diff --git a/packages/installer/src/calls/packageInstall.ts b/packages/installer/src/calls/packageInstall.ts index 4e97a0f0c2..1fb1f6816a 100644 --- a/packages/installer/src/calls/packageInstall.ts +++ b/packages/installer/src/calls/packageInstall.ts @@ -11,7 +11,8 @@ import { writeAndValidateFiles, postInstallClean, afterInstall, - checkInstallRequirements + checkInstallRequirements, + sendPackageInstalledResolvedNotification } from "../installer/index.js"; import { logs, getLogUi, logUiClear } from "@dappnode/logger"; import { Routes } from "@dappnode/types"; @@ -102,6 +103,7 @@ export async function packageInstall( await postInstallClean(packagesData, log); afterInstall(dnpNames); await sendCoreInstalledResolvedNotification(packagesData); + await sendPackageInstalledResolvedNotification(packagesData); logUiClear({ id }); } catch (e) { afterInstall(dnpNames); diff --git a/packages/installer/src/installer/index.ts b/packages/installer/src/installer/index.ts index 7f31a81de0..b9187a7bd1 100644 --- a/packages/installer/src/installer/index.ts +++ b/packages/installer/src/installer/index.ts @@ -8,3 +8,4 @@ export * from "./runPackages.js"; export * from "./restartPatch.js"; export * from "./writeAndValidateFiles.js"; export * from "./checkInstallRequirements.js"; +export * from "./sendPackageInstallResolvedNotification.js"; diff --git a/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts b/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts new file mode 100644 index 0000000000..74dad2e5b3 --- /dev/null +++ b/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts @@ -0,0 +1,34 @@ +import { Category, InstallPackageData, Priority, Status } from "@dappnode/types"; +import { logs } from "@dappnode/logger"; +import { notifications } from "@dappnode/notifications"; +import { prettyDnpName } from "@dappnode/utils"; +import { params } from "@dappnode/params"; + +/** + * Send resolved notification for regular packages once installed/updated + * This dismisses the "update available" notification by sending a resolved status + * @param packagesData + */ +export async function sendPackageInstalledResolvedNotification(packagesData: InstallPackageData[]): Promise { + // Filter out core packages as they are handled separately + const regularPackages = packagesData.filter((p) => !params.corePackagesNotAutoupdatable.includes(p.dnpName)); + + for (const pkg of regularPackages) { + const title = `${prettyDnpName(pkg.dnpName)} updated successfully`; + const body = `${prettyDnpName(pkg.dnpName)} has been updated to version ${pkg.semVersion}`; + + await notifications + .sendNotification({ + title: title, + dnpName: pkg.dnpName, + body: body, + category: Category.system, + priority: Priority.low, + status: Status.resolved, + isBanner: false, + isRemote: false, + correlationId: "dappmanager-update-pkg" + }) + .catch((e) => logs.error(`Error sending resolved notification for ${pkg.dnpName}`, e)); + } +} From 93d3c960d0386a0e8f06a70af1576ad514185007 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 07:13:03 +0000 Subject: [PATCH 3/3] Update notification message to be more generic for installs and updates Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> --- .../src/installer/sendPackageInstallResolvedNotification.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts b/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts index 74dad2e5b3..a0b613c874 100644 --- a/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts +++ b/packages/installer/src/installer/sendPackageInstallResolvedNotification.ts @@ -14,8 +14,8 @@ export async function sendPackageInstalledResolvedNotification(packagesData: Ins const regularPackages = packagesData.filter((p) => !params.corePackagesNotAutoupdatable.includes(p.dnpName)); for (const pkg of regularPackages) { - const title = `${prettyDnpName(pkg.dnpName)} updated successfully`; - const body = `${prettyDnpName(pkg.dnpName)} has been updated to version ${pkg.semVersion}`; + const title = `${prettyDnpName(pkg.dnpName)} installed successfully`; + const body = `${prettyDnpName(pkg.dnpName)} version ${pkg.semVersion} has been installed successfully`; await notifications .sendNotification({