Skip to content

fix(accounts): editing one service-override field clears the override's other fields #1775

Closed

Description

@cristim

Problem

Editing one field of an account service override clears the override's other fields.

  • Frontend. The inline editors in Settings send ONE field per PUT /api/accounts/{id}/service-overrides/{provider}/{service}: payment only (frontend/src/settings.ts :828), term only (:953), coverage only (:1046), enabled only (:1123).
  • Backend. buildServiceOverride (internal/api/handler_accounts.go ~:1218) builds a FRESH row. existing supplies only ID and CreatedAt, and only the request's fields are applied.
  • Store. The upsert (internal/config/store_postgres_config_audit.go ~:172) then overwrites every column: enabled, term, payment, coverage, ramp_schedule and all include/exclude filters.

So changing an account's Term override sets its payment, coverage and enabled to NULL (inherit) and clears every include/exclude filter. The response is 200 and the toast says it succeeded.

Why it matters

The overrides scope what gets purchased for that account. A cleared exclude_regions / exclude_types / exclude_engines widens what can be bought, with no warning.

Fix

Merge the request over the existing row, presence-aware: a key that is absent keeps the stored value, an explicit null clears it to inherit, and a value replaces it. That's the same pattern as mergeServiceConfig (internal/api/handler_config.go ~:351) for PUT /api/config/service/.... The request struct is already all pointers with omitempty, and applyServiceOverrideFields is documented as "copies sparse request fields".

Tests:

  • a single-field PUT over a fully populated override keeps every other field;
  • a null clears just that field;
  • the commitment-option combo check runs on the merged result.

Found by the #19 adapter audit.

Activity

  1. cristim commented on Nov 5, 2026

    @cristim
    MemberAuthor

    Claiming: claude-ui-fix-1 (fleet). Fix: a presence-aware merge over the existing row, as mergeServiceConfig does, plus a per-field round-trip test for AccountServiceOverrideRequest.

  2. cristim commented on Nov 5, 2026

    @cristim
    MemberAuthor

    Claimed by claude-ui-fix-1: fix in progress (presence-aware merge plus per-field survival tests), TDD on fix/1775-override-sparse-merge. Opening as soon as it's verified, per the coordinator, even over the slot cap.

  3. cristim commented on Nov 5, 2026

    @cristim
    MemberAuthor

    Claimed by claude-ui-fix-1: PR #1788 open at 8068716, with reviewers qa-ui-4 and darling.

  4. added a commit that references this issue on Nov 6, 2026
    e86860c
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