Skip to content

fix(frontend): fan-out modal says an incompatible bucket is skipped, then submits it #1904

Description

@cristim

Summary

When a bulk selection produces a bucket whose term and payment combination is unsupported, the fan-out modal renders 'This bucket will be skipped'. The execute handler then maps over every bucket with no compatibility filter and submits it anyway, and the backend only warns for that combination. An approval email is minted for a commitment the UI said would not be submitted, and the modal's total upfront and total savings header counts that bucket's money too.

Location

frontend/src/recommendations.ts:4336 at 3c0f8ac

Failure scenario

A bulk selection produces two buckets, one of which fails isBucketPaymentCompatible (for example AWS RDS 3yr + no-upfront). renderFanOutBucketSection renders "Invalid combo: … This bucket will be skipped." handleFanOutExecute in frontend/src/app.ts:534 maps over buckets with no compatibility filter, so both buckets are POSTed. The backend only warns for that combination (cmd/validators.go:warnRDS3YearNoUpfront), so an approval email is minted for a commitment the UI just told the user would not be submitted. The confirm dialog and the "Total upfront / Total savings" header (computeFanOutTotals, line 4295) also count the skipped bucket's money.

Evidence

status.textContent = compat
  ? `${b.capacityPercent}% capacity · ${b.term}yr · ${b.payment}`
  : `Invalid combo: ${b.provider} / ${serviceLabel} doesn't support ${b.term}yr + ${b.payment}. This bucket will be skipped.`;
// app.ts:534 — no filter:
const promises = buckets.map((b) => api.executePurchase(b.recs.map(...), b.capacityPercent));

Suggested fix

Filter incompatible buckets out of currentFanOutBuckets before handleFanOutExecute runs (or exclude them from getFanOutBuckets), and exclude them from computeFanOutTotals and the email count.


Found by the 2026-09-02 codebase audit, finding A12-002, reported by one reviewer and independently confirmed by a second. Full report: docs/audits/codebase-audit-2026-09-02.md.

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