Skip to content

bug(api/history): handler ignores provider/account_ids/start/end query params from Purchase History + Purchases-page Global filters #701

Closed

Description

@cristim

Frontend sends provider, account_ids, start, end query params for the Purchase History date filter (row 3.4) and the Purchases-page Global filter (rows 4.2 / 4.4 / 4.5). Backend internal/api/handler_history.go fetchPurchaseHistory (lines 390-419) reads only account_id and limit — the rest are logged-or-silently-dropped. Visible filter affordances are no-ops.

Likely covers issue #503 (Savings History chart same backend gap) — consider bundling.

Fix direction

Backend: extend fetchPurchaseHistory to parse provider, account_ids (via parseAccountIDs), and start/end (validated as YYYY-MM-DD). Add a date-range overload (or nullable params) to the store GetPurchaseHistory family so SQL appends AND provider=$? AND account_id = ANY($?) AND scheduled_date BETWEEN $? AND $?. Mirror to fetchExecutionsAsHistory so both halves of the merged list respect the filter set. Bring both halves into a shared filter struct.

Surfaced by QA spreadsheet rows 3.4 / 4.2 / 4.4 / 4.5.

Activity

  1. added a commit that references this issue on May 25, 2026
    fd33b50
  2. cristim commented on May 26, 2026

    @cristim
    MemberAuthor

    QA verification still failing after PR #716 merged

    Verification re-tested today on rows 4.2, 4.4, 4.5 of the spreadsheet (Bugs and improvement suggestions tab, rows 305-307). All three sub-flows of the global filter on the Purchases page still fail:

    4.2 (Provider filter): Selecting one provider at a time -> "Same as before - Nothing happens, no data is filtered."

    4.4 (Account filter):

    1. Approval queue and Purchase History do NOT filter when an account is selected.
    2. Savings History chart DISAPPEARS (as if there's no data) when an account is selected, including for the AWS account that the purchase was actually made under.

    4.5 (Provider + Account): Same as 4.4.

    So the merged fix didn't propagate the global filter state down into:

    • Approval queue list
    • Purchase History list
    • Savings History chart (worse: chart hides entirely)

    PR #716 may have only wired up some of the consumers, or there's a separate frontend bug. Reopening this thread - please re-investigate.

  3. cristim commented on May 28, 2026

    @cristim
    MemberAuthor

    Verified as resolved via QA exploratory testing (marked Pass in the QA spreadsheet). Shipped in PR #716 (and follow-up PR #741 merged for full topbar-filter coverage). Closing.

  4. reopened this on Jun 4, 2026
  5. added
    pr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)
    pr-mergedThe PR for this issue has been merged
    on Jun 7, 2026
  6. added a commit that references this issue on Sep 27, 2026
    82c50fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mDaysimpact/manyAffects most userspr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)pr-mergedThe PR for this issue has been mergedpriority/p1Next up; this sprintseverity/mediumModerate harmtriagedItem has been triagedtype/bugDefecturgency/this-sprintWithin the current sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions