mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix: distinguish partial vessel snapshots from stale data
This commit is contained in:
1 parent
531ef52ca4
commit
a25ee64209
13 files changed
+155
-3
No files matched your search
@@ -102,6 +102,7 @@ export function createIngestion({
|
||||
feed.lastMessageAt = snapshot.lastMessageAt;
|
||||
feed.rawRowCount = snapshot.rawRowCount;
|
||||
feed.acceptedRowCount = snapshot.acceptedRowCount;
|
||||
feed.partial = payload?.complete === false;
|
||||
|
||||
if (snapshot.acceptedRowCount === 0) {
|
||||
feed.count = readCount();
|
||||
@@ -133,7 +134,8 @@ export function createIngestion({
|
||||
feed.count = readCount();
|
||||
feed.stale =
|
||||
Boolean(payload?.refreshing) ||
|
||||
payload?.complete === false ||
|
||||
payload?.freshness === 'stale' ||
|
||||
snapshot.transportStatus === 'stale' ||
|
||||
payload?.freshness === 'unknown';
|
||||
feed.newestPositionAt = payload?.newestPositionAt || null;
|
||||
// Not unconditionally null: a degraded feed keeps its reason even though the
|
||||
@@ -190,6 +192,7 @@ export function createVesselFeed() {
|
||||
loading: false,
|
||||
loaded: false,
|
||||
stale: false,
|
||||
partial: false,
|
||||
error: null,
|
||||
loadingLabel: '',
|
||||
lastUpdate: null,
|
||||
|
||||
Reference in new issue
Block a user