Skip to content

fix(history): one execution row with a NULL error hides every actionable execution #1465

Closed

Description

@cristim

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

  1. added 2 commits that reference this issue on Oct 26, 2026
    dfad3e9
    2e8a9a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions