mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
fix: order failure pattern timestamps chronologically
(cherry picked from commit 075d55e9cb)
This commit is contained in:
1 parent
3a26147843
commit
c2a28b2963
2 files changed
+22
-2
No files matched your search
@@ -85,7 +85,7 @@ function detectPatterns(skillRuns, options = {}) {
|
||||
}
|
||||
|
||||
const sortedRuns = [...group.runs].sort(
|
||||
(a, b) => (b.createdAt || '').localeCompare(a.createdAt || '')
|
||||
(a, b) => (Date.parse(b.createdAt) || 0) - (Date.parse(a.createdAt) || 0)
|
||||
);
|
||||
|
||||
const firstSeen = sortedRuns[sortedRuns.length - 1].createdAt || null;
|
||||
@@ -112,7 +112,7 @@ function detectPatterns(skillRuns, options = {}) {
|
||||
// Sort by count descending, then by lastSeen descending
|
||||
return patterns.sort((a, b) => {
|
||||
if (b.count !== a.count) return b.count - a.count;
|
||||
return (b.lastSeen || '').localeCompare(a.lastSeen || '');
|
||||
return (Date.parse(b.lastSeen) || 0) - (Date.parse(a.lastSeen) || 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user