Skip to content

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

@sakal-s

Description

@sakal-s

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions