From c44939ceee411aecb499c404a642edbddcd22e08 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 14 Oct 2025 14:06:55 +0200 Subject: [PATCH] Tariffs: sort by time when merging rate updates --- tariff/helper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tariff/helper.go b/tariff/helper.go index 239eb3ef3..47281234b 100644 --- a/tariff/helper.go +++ b/tariff/helper.go @@ -48,6 +48,8 @@ func mergeRates(data *util.Monitor[api.Rates], new api.Rates) { // mergeRatesAfter blends new and existing rates, keeping existing rates after timestamp func mergeRatesAfter(data *util.Monitor[api.Rates], new api.Rates, now time.Time) { + new.Sort() + var newStart time.Time if len(new) > 0 { new.Sort()