You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(history): one execution row with a NULL error hides every actionable execution #1465
Found by the second review of #1445. The bug predates that PR.
Problem:scanExecutionRows (internal/config/store_postgres.go, around line 2090) scans purchase_executions.error directly into the string field exec.Error. The column is nullable, so a single row with a NULL error fails the scan for the whole result set. The history handler then loses the entire actionable class (pending, notified, paused, scheduled) for every viewer, not only for that row's owner. Approvals can vanish from the queue until the row changes.
How it was seen: the #1445 integration test ActionableOverCap seeded error as NULL and failed with a scan error. Re-seeded with '', it passed.
Fix:
Scan error through sql.NullString, or COALESCE(error, '') in every query that feeds scanExecutionRows, so one row can't break the list.
Optionally backfill existing NULLs to '' and add NOT NULL DEFAULT '' in a migration, numbered above main's highest.
Add a real-Postgres regression test where one execution has a NULL error and the others still list.
Test hardening from the same review: these mutations still pass the #1445 tests:
dropping paused from the actionable set;
a page size of 1;
dropping the cap flag.
Seed '' in ActionableOverCap so it fails for the right reason.
Activity
fix(config): tolerate a NULL error when scanning purchase executions (L…
fix(db): make purchase_history.ramp_step and purchase_executions.erro…