mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(flights): a stalled feed dims the tracked aircraft as STALE
When the whole feed backs off, no poll counts a miss, so the tracked aircraft read STALE at full brightness while no newer position came in. It now takes the same stale fade as a missed update, in the flights and military layers.
This commit is contained in:
1 parent
c87510fd2e
commit
447cc08783
5 files changed
+49
-9
No files matched your search
@@ -791,6 +791,26 @@ test('a repeated old fix counts as a missed update for the tracked plane', () =>
|
||||
}
|
||||
});
|
||||
|
||||
test('a stalled feed dims the tracked plane as STALE', () => {
|
||||
const { fixes, info } = outOfCoverage();
|
||||
const h = harness({ fixes, info, nowMs: pastReport(-5) });
|
||||
try {
|
||||
h.tracking._startTrail(ICAO);
|
||||
h.run(pastReport(-2));
|
||||
// The whole feed is backing off: no poll counts a miss, and no newer
|
||||
// position is coming in.
|
||||
h.flightState.feed._backoff = true;
|
||||
assert.deepEqual(h.tracking._trackedStaleCue(ICAO), {
|
||||
text: 'STALE',
|
||||
dimmed: true,
|
||||
});
|
||||
assert.equal(h.tracking._trackedIconColor().alpha, STALE_ALPHA);
|
||||
assert.equal(h.flightState.records.missingPolls.has(ICAO), false);
|
||||
} finally {
|
||||
h.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test('a report arriving after the plane has stopped: it eases in with no spur, and the trail keeps everything up to the stop', () => {
|
||||
const { fixes, info } = outOfCoverage();
|
||||
info.lastContactEpochMs = fixes.at(-1).epochMs;
|
||||
|
||||
Reference in new issue
Block a user