From 4dd3d59e67ff067c95f1e56a39074240d03599d6 Mon Sep 17 00:00:00 2001 From: Tet-9 Date: Sat, 30 May 2026 01:22:46 +0100 Subject: [PATCH] fix(miners): use closed_at for CLOSED PRs in pull request window filter Both getPullRequests and getPullRequestsByRepo were filtering CLOSED pull requests by created_at >= since, causing PRs closed within the scoring window but opened before it to be omitted from miner results. Fix both query branches to use closed_at >= since for CLOSED state, consistent with how merged_at is used for MERGED and how the sibling issues endpoint already handles closed issues. Fixes #139 --- packages/das/src/api/miners/miners.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/das/src/api/miners/miners.service.ts b/packages/das/src/api/miners/miners.service.ts index 2469d98..6fdd6f2 100644 --- a/packages/das/src/api/miners/miners.service.ts +++ b/packages/das/src/api/miners/miners.service.ts @@ -193,7 +193,7 @@ export class MinersService { AND ( (p.state = 'OPEN' AND p.created_at >= $2) OR (p.state = 'MERGED' AND p.merged_at >= $2) - OR (p.state = 'CLOSED' AND p.created_at >= $2) + OR (p.state = 'CLOSED' AND p.closed_at >= $2) ) ORDER BY p.created_at DESC `, @@ -242,7 +242,7 @@ export class MinersService { AND ( (p.state = 'OPEN' AND p.created_at >= w.since) OR (p.state = 'MERGED' AND p.merged_at >= w.since) - OR (p.state = 'CLOSED' AND p.created_at >= w.since) + OR (p.state = 'CLOSED' AND p.closed_at >= w.since) ) ORDER BY p.created_at DESC `,