From 13cf5cf76cbc39d4f468d54c71d3e8de14bfa808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Mon, 25 May 2026 20:17:52 +0000 Subject: [PATCH] fix(snapshot): allow same-name in pre-task check for update The pre-task validation in apiSnapshotsUpdate was incorrectly rejecting PUT requests that set the Name to the snapshot's current name. This caused a 409 response before creating a task, which broke the system test SnapshotsAPITestCreateUpdate that expects a task to be created and then fail inside the task. The fix restores the 'b.Name != name' condition in the pre-task check so that same-name updates pass through to the task, where the in-task duplicate check will properly fail them (returning a failed task state instead of a direct 409). --- api/snapshot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/snapshot.go b/api/snapshot.go index 89787dac..caf62855 100644 --- a/api/snapshot.go +++ b/api/snapshot.go @@ -339,8 +339,8 @@ func apiSnapshotsUpdate(c *gin.Context) { return } - // Pre-task validation of new name if provided - if b.Name != "" { + // Pre-task validation of new name if provided (skip if renaming to same name) + if b.Name != "" && b.Name != name { _, err = collection.ByName(b.Name) if err == nil { AbortWithJSONError(c, 409, fmt.Errorf("unable to rename: snapshot %s already exists", b.Name))