fix: correct host health sampling

Keep the complete loaded history snapshot, sample only valid non-future recent batches, count seven-day failures independently, ignore disabled accounts in issue counters, and preserve loading and error states across batch completion.
This commit is contained in:
Sucukdeluxe
2026-08-16 23:03:18 +02:00
parent 0ee749617c
commit 5ace779b14
4 changed files with 272 additions and 15 deletions
+6 -5
View File
@@ -3614,11 +3614,12 @@ function _handleProgressImpl(data) {
function recordHosterHealthBatch(summary) {
if (!summary || typeof summary !== 'object' || !Array.isArray(summary.files)) return;
const current = Array.isArray(window._historyForStats) ? window._historyForStats : [];
const next = summary.id
? current.filter(batch => batch?.id !== summary.id)
: current.filter(batch => batch !== summary);
window._historyForStats = [summary, ...next].slice(0, 50);
const current = window._historyForStats;
if (!Array.isArray(current)) {
if (current === null) loadHistory();
return;
}
window._historyForStats = window.Stats.mergeHosterHealthHistory(current, summary);
_invalidateHosterLifetimeCache();
renderHosterHealthOverview();
}