fix: seven quick-win bug fixes #111

Merged
lerko merged 1 commits from fix/quick-wins into main 2026-06-11 22:38:43 +00:00
Owner

Summary

Seven independent small fixes from the review-findings backlog.

  1. Alertless monitors no longer spam error logstriggerAlert returns early when alertID <= 0
  2. HTTP response body drained before close — enables keep-alive connection reuse
  3. /api/backup/export enforces GET — was the only endpoint accepting any method
  4. limitStr guards against max < 3 — prevents panic on very narrow terminals
  5. Filter input accepts multibyte charactersmsg.Runes instead of msg.String() byte check
  6. Startup warning corrected — with no cluster secret, endpoints reject (401), warning now says so
  7. UPTOP_KEYS file open failure logged — was silently swallowed

Test plan

  • go test -count=1 ./... — all pass
  • golangci-lint — 0 issues
  • Existing limitStr tests pass (including max=3 edge case)
## Summary Seven independent small fixes from the review-findings backlog. 1. **Alertless monitors no longer spam error logs** — `triggerAlert` returns early when `alertID <= 0` 2. **HTTP response body drained before close** — enables keep-alive connection reuse 3. **`/api/backup/export` enforces GET** — was the only endpoint accepting any method 4. **`limitStr` guards against `max < 3`** — prevents panic on very narrow terminals 5. **Filter input accepts multibyte characters** — `msg.Runes` instead of `msg.String()` byte check 6. **Startup warning corrected** — with no cluster secret, endpoints reject (401), warning now says so 7. **`UPTOP_KEYS` file open failure logged** — was silently swallowed ## Test plan - [x] `go test -count=1 ./...` — all pass - [x] `golangci-lint` — 0 issues - [x] Existing `limitStr` tests pass (including `max=3` edge case)
lerko added 1 commit 2026-06-11 22:33:23 +00:00
fix: seven quick-win bug fixes across engine, server, TUI, CLI
CI / test (pull_request) Successful in 1m55s
CI / lint (pull_request) Successful in 1m27s
CI / vulncheck (pull_request) Successful in 1m1s
5d2b7a3e66
1. Alertless monitors no longer spam error logs — triggerAlert
   returns early when alertID <= 0.

2. HTTP response body drained before close — enables connection
   reuse via keep-alive instead of fresh TCP+TLS per check.

3. /api/backup/export enforces GET — was the only endpoint
   accepting any HTTP method.

4. limitStr guards against max < 3 — prevents negative slice
   index panic on very narrow terminals.

5. Filter input accepts multibyte characters — len(msg.Runes)
   instead of len(msg.String()) for proper Unicode support.

6. Startup warning corrected — with no UPTOP_CLUSTER_SECRET,
   endpoints reject (401), not accept. Warning now says so.

7. UPTOP_KEYS file open failure logged — was silently swallowed,
   leaving operators with no admin seeded and no message.
lerko merged commit 5d2b7a3e66 into main 2026-06-11 22:38:43 +00:00
lerko deleted branch fix/quick-wins 2026-06-11 22:38:43 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lerkolabs/uptop#111