Say when a past year in review is counted from the retention cutoff

Aperta
#299 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nextjs, typescript
Ambito
backend

Direzione di ricerca

Start in src/lib/jobs/retention.ts: read HISTORY_RETENTION_MONTHS and the retentionCutoffs helper to see exactly which day events and snapshots are purged before. Then read computeYearSummary in src/lib/public-metrics/yearly.ts and trace how historyStart picks the window start, since that is where a purged year is silently counted from 1 January. Surface the effective start day on the year page and its images, and add a unit test with a year starting one day either side of the cutoff; done means both acceptance boxes hold.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: web bug priority: P3 size: S

Summary

The year in review counts events from stored data, and DevMacro deletes activity events and daily snapshots older than 13 months. So a past year's page undercounts once part of it has been purged, without saying so: in November 2026, the 2025 page counts only events from October 2025 onward.

Found while building the year in review slides (pull request for the slides issue), at 3dcd273 on 262-year-in-review.

Evidence

  • Retention: HISTORY_RETENTION_MONTHS = 13 and retentionCutoffs in src/lib/jobs/retention.ts:17 and :56-66 delete events with occurred_at before the cutoff and snapshots before its UTC date.
  • The totals count a past year from 1 January when the provider was connected before it (computeYearSummary in src/lib/public-metrics/yearly.ts, window from historyStart, which takes the earlier of the connection and the oldest stored event), so the purged months count as zero rather than as missing.
  • The slides (busiest day, longest run, most active provider) count only stored events too, and the partial year note only covers a first connection or first event after 1 January.

Expected

A year whose start is older than the retention cutoff says plainly that it is counted from the cutoff day (or shows no year that retention has fully removed), instead of presenting a partial count as the whole year.

Acceptance criteria

  • The year page and its images say from which day a past year is counted when retention has removed its earlier months.
  • Unit test at the cutoff boundary (a year starting one day before and one day after the cutoff).

Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown

Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
6h 56m
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.