fix: restore test-used functions, silence tx.Rollback closed errors, prune knip dead code
CI / Frontend deps check (push) Successful in 22s
CI / Go vulnerabilities (push) Successful in 32s
CI / Go build (push) Successful in 32s
CI / go mod tidy (push) Successful in 13s
CI / Knip (push) Failing after 33s
CI / Frontend build (push) Successful in 1m12s
CI / Svelte strict check (push) Has been skipped
CI / Frontend QC (audit) (push) Has been skipped
CI / Frontend QC (typecheck) (push) Has been skipped
CI / Frontend QC (lint) (push) Has been skipped
CI / Go vet (push) Successful in 57s
CI / golangci-lint (push) Successful in 1m8s
CI / Tests (prod) (push) Successful in 1m45s
CI / Tests (dev) (push) Successful in 2m5s
CI / Race (prod) (push) Successful in 3m27s
CI / Race (dev) (push) Successful in 4m52s

Restore processImage (images.go) and nonDepositPaymentType (handlers.go) with //nolint:unused — used in test files.
Fix 97 tx.Rollback defers to silently discard expected "tx is closed" error after commit.
Frontend: remove 44 unused shadcn-svelte files, 2 dead components, 9 stale npm deps, prune unused exports.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-07-09 19:20:25 +01:00
co-authored by Sisyphus
parent 9e6c415cc4
commit 407de74b51
87 changed files with 534 additions and 4594 deletions
+18 -18
View File
@@ -318,9 +318,9 @@ func UpdateProfileHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer func() {
if err := tx.Rollback(r.Context()); err != nil {
slog.Error("failed to rollback transaction", "err", err)
}
if err := tx.Rollback(r.Context()); err != nil && err.Error() != "tx is closed" {
slog.Error("failed to rollback transaction", "err", err)
}
}()
// If first or last name changed (via user edit), track the old names in history
@@ -725,9 +725,9 @@ func ChangePasswordHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer func() {
if err := tx.Rollback(r.Context()); err != nil {
slog.Error("failed to rollback transaction", "err", err)
}
if err := tx.Rollback(r.Context()); err != nil && err.Error() != "tx is closed" {
slog.Error("failed to rollback transaction", "err", err)
}
}()
_, err = tx.Exec(r.Context(), `UPDATE users SET password_hash = $1, updated_at = NOW() WHERE id = $2`, string(newHash), userID)
@@ -863,9 +863,9 @@ func AddPatchTestHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer func() {
if err := tx.Rollback(r.Context()); err != nil {
slog.Error("failed to rollback transaction", "err", err)
}
if err := tx.Rollback(r.Context()); err != nil && err.Error() != "tx is closed" {
slog.Error("failed to rollback transaction", "err", err)
}
}()
_, err = tx.Exec(r.Context(), `
@@ -958,9 +958,9 @@ func DeletePatchTestHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer func() {
if err := tx.Rollback(r.Context()); err != nil {
slog.Error("failed to rollback transaction", "err", err)
}
if err := tx.Rollback(r.Context()); err != nil && err.Error() != "tx is closed" {
slog.Error("failed to rollback transaction", "err", err)
}
}()
result, err := tx.Exec(r.Context(), `
@@ -1064,9 +1064,9 @@ func UploadProfilePictureHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer func() {
if err := tx.Rollback(r.Context()); err != nil {
slog.Error("failed to rollback transaction", "err", err)
}
if err := tx.Rollback(r.Context()); err != nil && err.Error() != "tx is closed" {
slog.Error("failed to rollback transaction", "err", err)
}
}()
_, err = tx.Exec(r.Context(), `UPDATE users SET profile_pic_url = $1 WHERE id = $2`, url, userID)
@@ -1185,9 +1185,9 @@ func UpdateNotificationPreferencesHandler(w http.ResponseWriter, r *http.Request
return
}
defer func() {
if err := tx.Rollback(r.Context()); err != nil {
slog.Error("failed to rollback transaction", "err", err)
}
if err := tx.Rollback(r.Context()); err != nil && err.Error() != "tx is closed" {
slog.Error("failed to rollback transaction", "err", err)
}
}()
if exists {