Repository navigation
Description
Area / route
Automations -> a workflow -> Executions sub-tab. Route: /dashboard/$id/automations/$amId/executions.
Steps to reproduce
- Open the Executions sub-tab of any workflow that has at least one run today (after 00:00 UTC).
- Open the date-range filter and choose a preset such as "Today" or "Last 7 days".
- Observe the resulting table.
Expected
- "Today" returns runs that happened today.
- "Last 7 / 14 / 30 days" (and any range whose end date is today) include today's runs.
- More generally, executions that ran on the chosen end date appear, regardless of the time of day they ran.
Actual
The entire end day is excluded:
- "Today" returns essentially zero rows (only a run at exactly 00:00:00.000 UTC could match).
- Every range preset silently drops today's runs.
Root cause is a date-to-timestamp collapse with no end-of-day handling and a local-vs-UTC mismatch:
- The presets set
to = startOfDay(today)in local time. - The table serializes
toas a bare date string:formatISO(range.to, { representation: 'date' })-> e.g."2026-06-24". No end-of-day adjustment. - The backend does
toDate = new Date("2026-06-24").getTime(), which JS parses as UTC midnight (2026-06-24T00:00:00.000Z), then filters with.lte('startedAt', toDate). wfExecutions.startedAtis a numeric epoch timestamp, so any run at a time > 00:00 UTC on the end day hasstartedAt > toDateand fails the predicate.
Confirmed by computation: new Date('2026-06-24').getTime() = 1782259200000 (UTC midnight); a run at 2026-06-24T07:30:00Z = 1782286200000; 1782286200000 <= 1782259200000 is false, so the run is excluded.
A secondary skew exists because the picker computes startOfDay in local time while the backend interprets the serialized date as UTC; in non-UTC timezones this shifts the boundary further.
Evidence (confirmed file:line)
services/platform/app/components/ui/forms/date-range-picker.tsx:60-82—getPresetDateRangereturnsto: startOfDay(today)(local midnight) for every range/todaypreset.services/platform/app/features/automations/executions/executions-table.tsx:372-377—handleDateRangeChangeserializestoviaformatISO(range.to, { representation: 'date' }), producing a bareYYYY-MM-DDwith no end-of-day adjustment.services/platform/app/routes/dashboard/$id/automations/$amId/executions.tsx:13,39andservices/platform/app/features/automations/hooks/queries.ts:52-67—dateTois passed through unchanged.services/platform/convex/workflow_executions/queries.ts:102-114—listExecutionsforwardsargsdirectly to the helper.services/platform/convex/workflows/executions/list_executions_paginated_native.ts:30,47,61,71—toDate = new Date(args.dateTo).getTime()(UTC midnight) and.lte('startedAt', toDate)on every index branch.services/platform/convex/workflows/schema.ts:28—startedAt: v.number()(epoch ms), indexedby_definition_startedAt(line 69).
Notes
- Fix the end boundary to be inclusive of the whole end day. Two clean options: (a) on serialization, send
dateToas the end-of-day instant (e.g.endOfDay(range.to)-> a full ISO datetime, with the local/UTC convention made explicit and consistent with howdateFromis interpreted); or (b) in the backend, treat a bare datedateToas end-of-day by adding 24h - 1ms (or using a strict<against the start of the next day). Whichever is chosen, make the picker's localstartOfDayand the backend's parsing agree on a single timezone convention so thedateFromlower bound anddateToupper bound are symmetric. - The same picker/serialization pattern may be reused by other list filters; if the fix lands in the shared
date-range-pickerserialization path or a shared backend date-parse helper, audit other consumers for the same off-by-one-day exclusion.
Filed by an automated manual-review pass (live browser QA + a 25-agent code-grounded audit, each finding adversarially verified). Deduped against open issues (incl. #1972–#1999, settings/forms epic #1941–#1966, audit cluster #1842–#1846) and recently-closed issues.
Activity
fix: include the entire end day in executions date-range filter (#2075)…