From cbfd0e63edcc68691104040767db2e4d137a9b11 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 24 Feb 2026 19:43:40 +0100 Subject: [PATCH] fix: pass pointer to xorm Update to avoid hash panic in transaction mode In transaction mode, xorm stores the bean argument as a map key in afterUpdateBeans. Since Task contains slices and maps (unhashable types), passing a Task value causes "hash of unhashable type" panic. Passing a pointer (&ot) fixes this since pointers are always hashable. --- pkg/models/tasks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 648792f1d..f264b0e1f 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -1382,7 +1382,7 @@ func (t *Task) updateSingleTask(s *xorm.Session, a web.Auth, fields []string) (e _, err = s.ID(t.ID). Cols(colsToUpdate...). - Update(ot) + Update(&ot) *t = ot if err != nil { return err