From eb08245b3d537556fd49e957f8e9fe959f382259 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 13 Feb 2026 13:24:45 +0530 Subject: [PATCH] fix: pass epoch timestamps to comparison builders The comparison rake task was passing YYYY-MM-DD strings as since/until, but DateRangeHelper parses those fields as Unix seconds via DateTime.strptime(value, '%s'), causing validation to run against the wrong time window. --- lib/tasks/reporting_events_rollup_compare.rake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tasks/reporting_events_rollup_compare.rake b/lib/tasks/reporting_events_rollup_compare.rake index d83f423a2..771a139a3 100644 --- a/lib/tasks/reporting_events_rollup_compare.rake +++ b/lib/tasks/reporting_events_rollup_compare.rake @@ -101,9 +101,12 @@ namespace :reporting_events_rollup do days.each_with_index do |day, day_index| # Build base params for this day + # DateRangeHelper#parse_date_time expects epoch seconds (DateTime.strptime(value, '%s')) + day_start = tz.parse(day[:start].to_s).to_i.to_s + day_end = (tz.parse(day[:end].to_s) + 1.day).to_i.to_s base_params = { - since: day[:start].to_s, - until: day[:end].to_s, + since: day_start, + until: day_end, type: dimension[:name], timezone_offset: tz.utc_offset / 3600.0, business_hours: false