You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes CLOSED filter to use closed_at — does not fix sort order
No open/closed issue
ORDER BY p.created_at DESC for CLOSED PRs
Description
GET /api/v1/miners/:githubId/pulls and POST .../pulls (per-repo variant) both sort all results by p.created_at DESC. After #139 fixes the window filter for CLOSED PRs to use closed_at >= since, the sort order remains anchored to created_at.
This means a PR opened 60 days ago but closed 2 days ago will appear near the bottom of results behind PRs opened more recently, even though it is the most recently resolved. Validators consuming the miner API see an ordering that does not reflect actual activity recency for closed PRs.
Steps to Reproduce
Mirror a repo with a miner-authored PR: created_at = 60 days ago, closed_at = 2 days ago, state = CLOSED.
Call GET /api/v1/miners/{authorId}/pulls?since= (ISO timestamp 30 days ago).
Duplicate check
closed_at— does not fix sort orderORDER BY p.created_at DESCfor CLOSED PRsDescription
GET /api/v1/miners/:githubId/pullsandPOST .../pulls(per-repo variant) both sort all results byp.created_at DESC. After #139 fixes the window filter forCLOSEDPRs to useclosed_at >= since, the sort order remains anchored tocreated_at.This means a PR opened 60 days ago but closed 2 days ago will appear near the bottom of results behind PRs opened more recently, even though it is the most recently resolved. Validators consuming the miner API see an ordering that does not reflect actual activity recency for closed PRs.
Steps to Reproduce
created_at= 60 days ago,closed_at= 2 days ago,state=CLOSED.GET /api/v1/miners/{authorId}/pulls?since=(ISO timestamp 30 days ago).Expected Behavior
Results should reflect recency by the timestamp most meaningful to each state:
OPEN->created_atMERGED->merged_atCLOSED->closed_atA unified sort could use
COALESCE(p.merged_at, p.closed_at, p.created_at) DESC.Actual Behavior
Both
getPullRequestsandgetPullRequestsByRepouseORDER BY p.created_at DESCfor all states regardless of PR state.Files
packages/das/src/api/miners/miners.service.ts—ORDER BYclause in both query variants (~line 198 and ~line 247).Environment