Bug: Sort/filter mismatch in auto-close-duplicates script causes missed issues

Resolved 💬 1 comment Opened Apr 23, 2026 by sakal-s Closed May 27, 2026

Description

In scripts/auto-close-duplicates.ts (lines 123-141), there is a mismatch between how issues are paginated and how they are filtered:

  • Issues are fetched from the API without specifying a sort parameter (defaults to sorting by updated time)
  • But the filtering logic checks created_at <= threeDaysAgo

This mismatch means:

  • An issue created 10 days ago but updated 1 hour ago will appear early in pagination
  • An issue created 2 days ago but not updated recently may not appear until later pages
  • This can cause the script to miss issues that should be processed or process them inefficiently

Expected Behavior

The sort parameter and the filter condition should be aligned — either:

  • Sort by created time explicitly and filter by created_at, or
  • Sort by updated time and filter by updated_at

Suggested Fix

Add sort=created to the API request to align with the created_at filter logic.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗