[BUG] Weekly issue closure totals use creation dates

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

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

@Dhruvdesai793 đang làm issue này rồi.

Từ ngày 3/12/2026.

  • #4077 của @Dhruvdesai793 — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug needs-triage status:assigned
What happened?

The weekly summary buckets authored issues by created_at even when counting closures. An issue opened more than 14 days ago and closed this week is omitted from both weekly closure totals; a recent issue closed later can be attributed to its creation week. In src/app/api/metrics/weekly-summary/route.ts, the issue search filters by creation date, the response shape omits closed_at, and closure counters use createdAt. Expected: closure totals use the actual closure week.

Proposed solution: Fetch the relevant closed issues by closure date, bucket closures using closed_at, and retain created_at only for opened counts. Add fixed-clock tests for an older issue closed this week and a recent issue closed in a later week.

Steps to reproduce
  1. Open an issue more than 14 days ago.
  2. Close it during the current week.
  3. Request GET /api/metrics/weekly-summary.
  4. Observe that the closure is absent from the weekly closure total. A recently created issue closed in a later week can also be attributed to the wrong week.
Where is it?

API

Where did you see it?

Local development

Browser and device

Not browser-specific: server-side API route. Local environment: Linux x86_64, Node v26.13.1, Vitest 4.1.12.

Screenshots, console errors or logs

No screenshot applies to this API behavior. Validation: ./node_modules/.bin/tsc --noEmit completed successfully. Focused existing tests ./node_modules/.bin/vitest run test/goals-sync-lib.test.ts test/weekly-summary-combined.test.ts --reporter=dot passed (2 files, 28 tests); those tests do not cover issue closure-date bucketing. Full ./node_modules/.bin/vitest run: 3,405 passed, 54 failed. All 54 failures were in six component suites because localStorage was undefined in JSDOM; they are unrelated to this API path. The current tests do not cover closing an older issue in the current week, so the regression cases above should be added.

Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
Ngôn ngữ chính
TypeScript
Star
246
Fork
436
Merge trung bình
9 giờ 33 phút
Pull request đã merge (30 ngày)
213

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 Priyanshu-byte-coder/devtrack

Tất cả issue của Priyanshu-byte-coder/devtrack

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.