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

Đang mở
#299 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
nextjs, typescript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
1
Fork
1
Merge trung bình
6 giờ 56 phút
Pull request đã merge (30 ngày)
136

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eddiejaoude/StackDash

Tất cả issue của eddiejaoude/StackDash

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.