Skip to main content
← Back to list
01Issue
BugShippedSwamp Club
Assigneesstack72

Relationships

#872 Activity heatmap clips the current UTC day — uses local browser time for "today" but snapshots are UTC-keyed

Opened by keeb · 6/28/2026· Shipped 6/30/2026

Summary

The profile activity heatmap does not render the current UTC day's cell when the viewer's local date is behind UTC (e.g. evening in the Americas, after 00:00 UTC). The data exists — it's a timezone mismatch in the grid's today calculation, not missing data.

Evidence

On 2026-06-28 ~02:00 UTC (still 2026-06-27 local in US timezones), webframp's profile heatmap showed no 06-28 cell, even though a daily snapshot for that date exists:

  • metric_snapshots_daily row webframp:2026-06-28 → totalScore 5,391,746 (present).
  • Heatmap's last rendered cell = local "today" (06-27), so 06-28 is clipped.

Root cause

islands/ActivityHeatmap.tsx:

  • L203-205: const today = new Date(); today.setHours(0, 0, 0, 0); — this is local browser time.
  • L213-214: the grid's bottom-right end is pinned to local today.
  • L234-235: cells past local today are intentionally not rendered.

But the snapshot data is keyed by UTC date (the snapshot writers use toISOString().slice(0, 10)). When UTC has rolled to the next day but the viewer's local clock has not, the current UTC day's snapshot falls past local today and is clipped. (Symmetrically, a viewer east of UTC can get a trailing empty "today" cell with no data yet.)

Steps to reproduce

  1. Be in a timezone behind UTC (e.g. US Pacific/Eastern).
  2. After 00:00 UTC (but before local midnight), open any profile with activity, e.g. /u/webframp.
  3. The heatmap's most recent cell is the local date; the current UTC day's cell is missing despite a metric_snapshots_daily row existing for it.

Suggested direction

Compute today and the grid end in UTC so they match the UTC-keyed snapshot rows — e.g. derive the day boundary from getUTCFullYear/getUTCMonth/getUTCDate (or a UTC YYYY-MM-DD string) rather than local new Date() + setHours. Keep the "don't render past today" guard, but evaluate "today" in UTC.

Environment

swamp.club profile heatmap (islands/ActivityHeatmap.tsx). Surfaced 2026-06-28 UTC. Separate from the score/rollup work in epic #847.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

6/30/2026, 10:04:53 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/30/2026, 9:29:33 AM

Sign in to post a ripple.