mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 00:02:25 +00:00
fix(gnss): expire stale cells on re-enable; pin the unpruned return-after-window path
Re-enabling after a disable longer than the window no longer shows the old cells until the next refresh. A healthy report arriving 31 minutes after a degraded one, with no prune in between, starts clean; exactly 30 minutes still counts.
This commit is contained in:
1 parent
fde8b2a64f
commit
7e570a79ad
4 files changed
+43
-6
No files matched your search
@@ -284,6 +284,21 @@ test('cells expire while no view anchor is available', async () => {
|
||||
assert.equal(layer.getStats().error, null);
|
||||
});
|
||||
|
||||
test('re-enabling after a long disable does not show cells past the window', async () => {
|
||||
const { layer, sources, advance, now } = harness(async () => ({
|
||||
rows: threeHealthy(),
|
||||
fetchedAt: now(),
|
||||
}));
|
||||
layer.enable();
|
||||
await layer.update();
|
||||
assert.equal(sources[0].entities.values.length, 1);
|
||||
layer.disable();
|
||||
advance(31 * MIN);
|
||||
layer.enable();
|
||||
assert.equal(layer.getStats().count, 0);
|
||||
assert.equal(sources[0].entities.values.length, 0);
|
||||
});
|
||||
|
||||
const threeCells = () => ({
|
||||
rows: [row('a1', 50.1, true), row('a2', 50.1, true), row('a3', 50.2, false)],
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user