fix: distinguish partial vessel snapshots from stale data

This commit is contained in:
Sameh Khamis committed 2026-09-16 11:52:26 -07:00
1 parent 531ef52ca4
commit a25ee64209
13 files changed
+155 -3

No files matched your search

+2 -1
View File
@@ -3,7 +3,7 @@ import { GUIDANCE_STATUSES } from '../loadingFeedback.js';
/**
* Normalize heterogeneous layer stats into one honest control-chip state.
* @param {object|null} stats Layer getStats() result.
* @returns {'nominal'|'loading'|'degraded'|'stale'|'fallback'|'unavailable'} Feed state.
* @returns {'nominal'|'loading'|'degraded'|'stale'|'partial'|'fallback'|'unavailable'} Feed state.
*/
export function layerFeedState(stats = {}) {
const state = stats || {};
@@ -50,5 +50,6 @@ export function layerFeedState(stats = {}) {
state.available === false
)
return 'degraded';
if (state.partial === true) return 'partial';
return 'nominal';
}