Fixed: Analytics Dashboards Were Silently Reporting Zero
A SQL bug that compared dates as literal text instead of evaluating them meant every Analytics metric could read zero regardless of real traffic — now fixed.
This is one of the more dramatic bugs we've had to explain plainly, precisely because the symptom looked so ordinary: an Analytics dashboard with every number at zero. It's the kind of thing that's easy to mistake for "this workspace just doesn't have much traffic yet." In this case, that wasn't necessarily true — the dashboard could report zero even when real traffic was flowing through, because of how one date comparison was written.
What actually went wrong
The dashboard's period-start calculation used to be built as a SQL expression string — something like a date('now', '-7 days')-style expression — and passed through as a bound parameter. D1 treats a bound parameter as a literal value to compare against, not as an expression to evaluate. So instead of computing "seven days ago" and comparing event timestamps against that computed date, the query was comparing every event's created_at against the literal text of the expression itself. Nothing could ever be greater than or equal to a string like that in the way the query intended, so the comparison silently failed for every row, every time. Every metric built on top of that comparison — visits, unique visitors, events, active users — came back as zero, regardless of how much real traffic the workspace actually had.
What's fixed
The period-start value is now computed directly in application code before the query runs, so the database receives an actual date to compare against rather than a piece of text that happened to look like one. The comparison works the way it was always supposed to, and dashboard numbers now reflect real event volume.
Why this is worth explaining in detail
A dashboard that reads zero doesn't look broken — it looks empty, which is very different from wrong, and much easier to walk past without questioning. If you looked at your Analytics dashboard recently and the numbers seemed suspiciously flat at zero, that wasn't necessarily a reflection of your traffic. It's fixed now, and the underlying event data your workspace tracked all along was never lost — only the dashboard's ability to read it correctly.