Skip to content

fix(frontend): silent fallbacks fabricate money/coverage values on Dashboard, History, Plans, Opportunities #1086

Closed

Description

@cristim

Problem

Frontend code on multiple pages substitutes fabricated defaults for absent API fields on money-affecting display paths. This violates the project fail-loud / no-silent-fallbacks directive.

Findings (docs/code-review/19-hardcoded-fallbacks-frontend.md)

  • H-2 history.ts: data.summary || {} then ?? 0 coercions make money KPIs render $0 when API field absent
  • H-3 dashboard.ts: target_coverage || 80 hardcodes 80%; current_coverage || 0 fabricates 0%; savings catch falls to $0
  • H-4 plans.ts extractPlanInfo: defaults provider to 'aws', term to 3yr, coverage to 80% when absent (financial display error)
  • H-5 plans.ts: payment || 'no-upfront' pre-selects in edit modal, silently changing payment type on re-save
  • M-1..M-7, L-2: further ?? 0 / || 0 coercions on savings/upfront on Opportunities, approval modal, savings-history chart

Fix

Merged into PR #1046 (fix/frontend-xss-listeners commit aa8f16e). Absent fields render '--' or leave selects unset. Regression tests added.

Activity

  1. added
    bugSomething isn't working
    triagedItem has been triaged
    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
  2. cristim commented on Jul 27, 2026

    @cristim
    MemberAuthor

    Verification sweep against main (101f099fb) on 2026-07-27 finds this already resolved.
    The history/dashboard/plans views now pass null instead of fabricating money and coverage values when data is absent.
    Evidence: commit 84fcb9f (PR #1046).
    Recommending close. Reopen if a fabricated-value case remains in another view.

  3. cristim commented on Sep 2, 2026

    @cristim
    MemberAuthor

    Verified resolved at 3c0f8ac: history passes summary as null when absent, the dashboard derives current/target coverage as null instead of 0/80, extractPlanInfo returns null provider/term/coverage, and the plan edit modal leaves the payment select unset rather than pre-selecting no-upfront. Evidence: frontend/src/dashboard.ts:282, frontend/src/plans.ts:967, frontend/src/history.ts:261 (#1046). Residual axes checked: remaining '?? 0' uses are on fields declared as required number in api/types.ts (sort comparators, per-service current_savings, cumulative_savings) so they cannot mask an absent API field; plans.ts:1272 notification_days_before || 3 is not a money or coverage value. Closing as completed; reopen if the behaviour recurs.

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

    bugSomething isn't workingeffort/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/highSignificant 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