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

Abierto
#299 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
nextjs, typescript
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
1
Forks
1
Merge medio
6 h 56 min
PR fusionados (30 d)
136

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eddiejaoude/StackDash

Todos los issues de eddiejaoude/StackDash

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.