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

+12
View File
@@ -7,6 +7,7 @@ const FEED_STATE_LABELS = Object.freeze({
loading: 'LOADING',
degraded: 'DEGRADED',
stale: 'STALE',
partial: 'PARTIAL',
fallback: 'FALLBACK',
unavailable: 'UNAVAILABLE',
});
@@ -505,6 +506,17 @@ export class LayerPanel {
: stats.coverage || ago;
return `${stateLabel} · ${source} · ${detail}`;
}
if (feedState === 'partial') {
const { acceptedRowCount, rawRowCount } = stats;
const detail =
Number.isInteger(acceptedRowCount) &&
Number.isInteger(rawRowCount) &&
acceptedRowCount >= 0 &&
rawRowCount > acceptedRowCount
? `${acceptedRowCount} of ${rawRowCount} records accepted`
: 'incomplete snapshot';
return `${stateLabel} · ${source} · ${detail} · ${ago}`;
}
if (feedState === 'stale') {
const retry =
typeof stats.retryInSec === 'number' && stats.retryInSec > 0