Skip to content

fix: send notification on single container update#2357

Merged
kmendell merged 2 commits intogetarcaneapp:mainfrom
GiulioSavini:fix/single-container-update-notification
Apr 12, 2026
Merged

fix: send notification on single container update#2357
kmendell merged 2 commits intogetarcaneapp:mainfrom
GiulioSavini:fix/single-container-update-notification

Conversation

@GiulioSavini
Copy link
Copy Markdown
Contributor

@GiulioSavini GiulioSavini commented Apr 12, 2026

Fixes #1802.

What happened

The bulk Update Containers button sends Discord/Apprise notifications correctly. The per-container Update button (single container) was silently skipping them — SendContainerUpdateNotification was never called in either the compose-project or standalone success branch of UpdateSingleContainer.

Fix

Added the notification call in both success paths inside UpdateSingleContainer, mirroring exactly what restartContainersUsingOldIDs already does for bulk updates.

Testing

Trigger a single-container update via the container's Update button → notification fires. Bulk update → still fires. No-op update (digest unchanged) → no notification, same as before.

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

Greptile Summary

Adds SendContainerUpdateNotification calls to both success branches inside UpdateSingleContainer — the compose-project path and the standalone path — fixing a bug where single-container updates silently skipped Discord/Apprise notifications. The fix correctly mirrors the existing bulk-update implementation in restartContainersUsingOldIDs and preserves the no-op-skip behavior (no notification when digest is unchanged).

Confidence Score: 5/5

Safe to merge; the fix is correct and the only finding is a minor style point.

Both notification call sites use the correct function with semantically valid arguments. The only issue is a redundant double-normalization that is harmless at runtime. No P0 or P1 findings.

No files require special attention.

Fix All in Codex

Prompt To Fix All With AI
This is a comment left during a code review.
Path: backend/internal/services/updater_service.go
Line: 628

Comment:
**Redundant double-normalization for `newDigest`**

`normalizedRef` is already `s.normalizeRef(imageRef)`, so passing `s.normalizeRef(normalizedRef)` as `newDigest` applies the normalizer twice to the same string, making `imageRef` and `newDigest` identical in the notification. The bulk-update path intentionally passes the raw `p.newRef` as `imageRef` and `s.normalizeRef(p.newRef)` as `newDigest` so the two fields can differ (e.g. `"nginx:latest"` vs `"docker.io/library/nginx:latest"`). To match that pattern here, pass the pre-normalized `imageRef` as the second argument and `normalizedRef` as the last:

```suggestion
				if notifErr := s.notificationService.SendContainerUpdateNotification(ctx, containerName, imageRef, inspectBefore.Image, normalizedRef); notifErr != nil {
```

The same applies to the standalone path at line 662.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix: single container update now pings y..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@GiulioSavini GiulioSavini requested a review from a team April 12, 2026 17:54
@kmendell
Copy link
Copy Markdown
Member

kmendell commented Apr 12, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

out.Duration = time.Since(start).String()

if s.notificationService != nil {
if notifErr := s.notificationService.SendContainerUpdateNotification(ctx, containerName, normalizedRef, inspectBefore.Image, s.normalizeRef(normalizedRef)); notifErr != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Redundant double-normalization for newDigest

normalizedRef is already s.normalizeRef(imageRef), so passing s.normalizeRef(normalizedRef) as newDigest applies the normalizer twice to the same string, making imageRef and newDigest identical in the notification. The bulk-update path intentionally passes the raw p.newRef as imageRef and s.normalizeRef(p.newRef) as newDigest so the two fields can differ (e.g. "nginx:latest" vs "docker.io/library/nginx:latest"). To match that pattern here, pass the pre-normalized imageRef as the second argument and normalizedRef as the last:

Suggested change
if notifErr := s.notificationService.SendContainerUpdateNotification(ctx, containerName, normalizedRef, inspectBefore.Image, s.normalizeRef(normalizedRef)); notifErr != nil {
if notifErr := s.notificationService.SendContainerUpdateNotification(ctx, containerName, imageRef, inspectBefore.Image, normalizedRef); notifErr != nil {

The same applies to the standalone path at line 662.

Prompt To Fix With AI
This is a comment left during a code review.
Path: backend/internal/services/updater_service.go
Line: 628

Comment:
**Redundant double-normalization for `newDigest`**

`normalizedRef` is already `s.normalizeRef(imageRef)`, so passing `s.normalizeRef(normalizedRef)` as `newDigest` applies the normalizer twice to the same string, making `imageRef` and `newDigest` identical in the notification. The bulk-update path intentionally passes the raw `p.newRef` as `imageRef` and `s.normalizeRef(p.newRef)` as `newDigest` so the two fields can differ (e.g. `"nginx:latest"` vs `"docker.io/library/nginx:latest"`). To match that pattern here, pass the pre-normalized `imageRef` as the second argument and `normalizedRef` as the last:

```suggestion
				if notifErr := s.notificationService.SendContainerUpdateNotification(ctx, containerName, imageRef, inspectBefore.Image, normalizedRef); notifErr != nil {
```

The same applies to the standalone path at line 662.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Codex

@kmendell kmendell merged commit 1f8d72f into getarcaneapp:main Apr 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Bug: Container update discord notification

2 participants