From 72052fe1861a6d77fc0da2acad9b8616dd30c31d Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 25 Oct 2026 21:10:02 +1100 Subject: [PATCH] fix(postgres): skip unchanged authority in package audit --- internal/infrastructure/postgres/installed_packages.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/infrastructure/postgres/installed_packages.go b/internal/infrastructure/postgres/installed_packages.go index 7f47feb9c..021759411 100644 --- a/internal/infrastructure/postgres/installed_packages.go +++ b/internal/infrastructure/postgres/installed_packages.go @@ -1,6 +1,7 @@ package postgres import ( + "bytes" "context" "encoding/json" "errors" @@ -352,6 +353,10 @@ func auditReplace(ctx context.Context, q *postgresdb.Queries, p storepkg.Install if action != storepkg.ActionApproveUpdate && action != storepkg.ActionRollback { return nil } + // An unchanged authority, including none at all, is not an approval. + if bytes.Equal(current.AcceptedAuthority, accepted) { + return nil + } return insertAudit(ctx, q, "installed_packages", p.Name, "accept_authority", current.AcceptedAuthority, accepted, 0, p.OrgID) }