mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-18 21:22:28 +03:00
* fix(dashboard): count live usage_history rows in Free Tier 'used this month' (#10381) * fix(dashboard): use an indexable UTC month-range predicate for used-this-month (#10381) sumUsageTokensThisMonth() filtered usage_history with substr(timestamp, 1, 7) = strftime('%Y-%m', 'now') — a substr() expression SQLite cannot use a range index on, and fragile against any timestamp that isn't exactly ISO-shaped. Replace with an indexable inclusive-start/ exclusive-end UTC range: timestamp >= <month start> AND timestamp < <next month start>, matching the ISO 8601 format saveRequestUsage() already writes. Adds a boundary regression test: the first instant of the current month is included, the last instant of the previous month is excluded, and a next-month row is excluded too (covers the upper bound substr() could never express). --------- Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>