Skip to content

fix(settings): saving the Settings page reverts backend coverage propagation and an empty coverage field saves as 0 #522

Closed

Description

@cristim

Summary

After #500 the backend copies a changed default_coverage to service_configs. Saving the Settings page then undoes that propagation. Separately, an empty global coverage field saves as 0.

Location (origin/main 496d9d7)

  • frontend/src/settings.ts:3560 saveGlobalSettings PUTs every service with base?.coverage ?? settings.default_coverage, or the SP card's DOM value (3562-3566).
  • internal/api/handler_config.go:205 updateServiceConfig overlays existing.Coverage = cfg.Coverage unconditionally, so the stale value wins.
  • No coverage confirm dialog exists; only term and payment have one.
  • frontend/src/settings.ts:3482 Number('') is 0, and the check at 3483 accepts 0. wireInlineRangeValidation (:247) also accepts the empty string. Same pattern in frontend/src/plans.ts:1345.

Failure scenario

Probe: global coverage 50, ec2 and savings-plans-compute rows at 50. Set global to 0 and Save. Result: global 0, ec2 50, savings-plans-compute 50. Clearing the global coverage field and saving stores 0.

Context

Found in the #510 review. Related: #135 (closed), #225 (closed, same class for term/payment), #345.

Acceptance

Saving a changed global coverage leaves service rows at the propagated value, and an empty coverage field is rejected with an inline error instead of saving 0.

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