Skip to content

fix(manual-api): allow multiple overrides for lists (rates_import_override, rates_export_override) - #4658

Open
chickenonaraft88 wants to merge 1 commit into
springfall2008:mainfrom
chickenonaraft88:fix-manual-api-rate-override-dedup
Open

fix(manual-api): allow multiple overrides for lists (rates_import_override, rates_export_override)#4658
chickenonaraft88 wants to merge 1 commit into
springfall2008:mainfrom
chickenonaraft88:fix-manual-api-rate-override-dedup

Conversation

@chickenonaraft88

Copy link
Copy Markdown

What

Fixes #4405

Allow non-indexed dict_list overrides to accumulate rather than assuming they are all at index 0.

Fix

Both api_select_update() (storage) and get_arg() (the list-merge fetch.py's basic_rates() consumes) are now index-aware:

  • A no-index dict_list override only collides with an exact duplicate resend - distinct windows coexist.
  • An explicit index still replaces on resend, and distinct explicit indices still coexist, preserving the original indexed-override behaviour.
  • On read, a dict_list override's stored index only ever matters for write-time dedup - it has no meaning as an output list position, since these overrides are a bag of independent entries, not per-slot values.

Test plan

test_manual_api.py gained coverage for the storage-layer dedup rules, the get_arg/basic_rates merge behaviour, and the malformed-index guard - no prior test exercised multiple simultaneous no-index overrides at all, which is how this went unnoticed.

  • ./run_all --test manual_api --test basic_rates --test validate_config --test annual_tariff passes
  • ./run_pre_commit - all hooks pass (the one pre-existing failure, test_faq_recorder_config, is an unrelated Windows-only cp1252 decoding bug reproducible on main, not caused by this change)

🤖 Generated with Claude Code

image

…m colliding without an explicit index

dict_list overrides (rates_import_override, rates_export_override) hold
several simultaneous no-index time windows, but the manual API deduped
stored commands by name, so a new no-index window silently replaced the
previous one instead of coexisting (springfall2008#4405).

api_select_update() and get_arg() are now index-aware: a no-index
dict_list override only collides with an exact duplicate, while
explicit-index and scalar overrides keep replace-on-resend behaviour.
The stored index only dedupes at write time - it has no meaning as an
output list position.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chickenonaraft88 chickenonaraft88 changed the title fix(manual-api): allow multiple list overrides fix(manual-api): allow multiple overrides for lists (rates_import_override, rates_export_override) Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Predbat manual api no longer allows multiple rates_import_override

1 participant