t3code icon indicating copy to clipboard operation
t3code copied to clipboard

fix(server): IssueService.list ignores sort: "created" when merging entries

Open AymanKhan9 opened this issue 1 week ago • 0 comments

IssueService.list in apps/server/src/issue/IssueService.ts forwards sort: input.sort ?? "updated" to each issue tracker (line 457), but then unconditionally re-sorts the merged entries by b.updatedAt.localeCompare(a.updatedAt) (line 512).

Callers that pass sort: "created" and consume result.entries directly — such as WorkflowForge.issues.list and direct WebSocket RPC callers — receive updatedAt-ordered rows instead of newest-created-first rows. Additionally, comparing ISO-8601 strings with localeCompare misorders mixed timezone offsets across trackers (e.g., 2026-07-06T01:00:00+02:00 vs 2026-07-05T23:30:00Z).

Sorting merged entries by createdAt when sort === "created" (and updatedAt otherwise) using parsed timestamps with a string tie-breaker fixes both issues.

AymanKhan9 avatar Nov 24 '26 18:11 AymanKhan9