Skip to content

Home page Potential Monthly Savings shows $0 while Opportunities shows $212-$314 #749

Description

@cristim

Symptom

The Home page "Potential Monthly Savings" KPI shows $0 while the Opportunities page shows $212 – $314 for the same dataset (same Provider/Account filters, "All / All").

Screenshots: Home reads Potential Monthly Savings: $0 (23 recommendations). Opportunities reads Potential Monthly Savings: $212 – $314 (Total Recommendations 6).

Why it's a bug

These two views must reflect the same underlying recommendation aggregate. Either:

  1. The Home KPI is hitting a different endpoint (or path within the same endpoint) that returns 0, or
  2. The Home KPI is aggregating the wrong field (e.g. current_savings instead of potential_savings, or only "approved" recs instead of all active recs).

Note the recommendation count on Home is 23 -- which matches the variant count on Opportunities. So Home is reading the recs but failing to sum the savings.

Likely root cause hypothesis

frontend/src/dashboard.ts computes the Home KPIs from a separate API call (/api/dashboard or /api/home/kpis -- find the actual endpoint). The handler probably sums a field that is null/zero for all current recommendations. Inspect:

  • The handler's SELECT to confirm which column it sums.
  • The recommendation rows in the DB: do they have a potential_monthly_savings value (or equivalent)?
  • The Opportunities page handler's SELECT, which clearly does produce the correct $212 – $314 range.

If both pages should aggregate the same dataset, the cleanest fix is to make the Home KPI handler call the same aggregation path as Opportunities (factor out a shared aggregator).

Files likely involved

  • frontend/src/dashboard.ts (Home KPI rendering)
  • internal/api/handler_home.go or handler_dashboard.go (KPI aggregator)
  • Compare with internal/api/handler_opportunities.go or equivalent

Verification

After fix:

  • Home Potential Monthly Savings matches Opportunities Potential Monthly Savings for All/All, then again with a Provider filter, then with an Account filter.
  • The recommendation count on both pages also matches (depends on linked issue resolution).

Source

QA exploratory testing, 2026-05-27.

Activity

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