mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Keep STALE on Contacts while a poll is in flight
A poll that returned the same stale snapshot dropped STALE from the Contacts cohort until the next answer, because the in-flight loading flag outranked stale and the source revision ignored the provider name. A source that has answered now reads its status without the loading flag; one that has never answered (AIS first connect) still reads as loading, so it shows no STALE before any snapshot exists.
This commit is contained in:
1 parent
490c8d1769
commit
99831ea19b
5 files changed
+167
-5
No files matched your search
@@ -54,8 +54,14 @@ export function createSubject({ state: layerState, services, parts, source }) {
|
||||
const installationsState = sourceStates['military-installations'];
|
||||
const evaluatedAt = Date.now();
|
||||
// Whether the provider answered as a fallback or from a stale snapshot.
|
||||
// A poll in flight does not change that, and the source revision ignores it.
|
||||
// Before the first answer there is no snapshot, so loading stays.
|
||||
const sourceStatus = (sourceState) => {
|
||||
const feedState = layerFeedState(sourceState.stats);
|
||||
const feedState = layerFeedState(
|
||||
sourceState.available
|
||||
? { ...sourceState.stats, loading: false }
|
||||
: sourceState.stats,
|
||||
);
|
||||
return feedState === 'fallback' || feedState === 'stale'
|
||||
? feedState
|
||||
: null;
|
||||
|
||||
Reference in new issue
Block a user