Code quality plan, MR B: one-line correctness fixes
Phase B of the code quality action plan (https://gitlab.com/postgres-ai/database-lab/-/blob/docs/code-quality-action-plan/docs/plans/20260913-code-quality-assessment-action-plan.md). One MR.
Small, isolated correctness bugs. All confirmed on origin/master 8a42a6ef.
Findings
retrieval.go:372:||should be&&; both exemptions are dead, soMakeActiveandInitBranchingare skipped onerrNoJobs/SnapshotExistsErrorObservingClone.Stopblocks on<-c.doneforever whenRunSessionexits through the metrics error pathpostgres.go:122wraps a nil error on start timeout and reports success- auth middleware captures the verification token once (
server.go:265); reload swaps config only (#29 (closed)) splitFlagspanics on--extra-config foo/--tags foo(clone/actions.go:583)POST /observation/startwith bodynullnil-derefs; no recovery middleware on the router
Tasks
- 5.
&&pluserrors.Is(err, errNoJobs); table-driven test - 6.
defer close(c.done)inRunSession;Stop(ctx)selects ondoneandctx.Done(); caller atroutes.go:1163passesr.Context() - 7. Real error on Postgres start timeout with the last recovery state
- 8.
NewAuthtakes a token accessor that reads underconfigMu(closes #29 (closed)) - 9.
splitFlagsreturns an error; nil request afterReadJSONis a 400;mw.Recoveraround the router
Dependencies
- !1197 (merged) (#782 (closed)) fixes the
errors.As500 bug and must merge first - !1196 (merged) aligns the OpenAPI specs; keep out of this MR