Keep the saved Satellites state when Satellites is still busy as Space Missions turns off

When Satellites had not settled within the 30 s limit, turning Space Missions
off cleared the saved Satellites state and put the parameters back before
failing, so Satellites stayed on as Space Missions had switched it with
nothing left to retry. Now a busy Satellites layer is left untouched and the
saved state is kept, so turning Space Missions off again finishes the
restore. A Satellites action the person took still gets its parameters back.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 16:35:52 -08:00
1 parent 46e831620e
commit ee37511332
4 files changed
+52 -7

No files matched your search

@@ -177,3 +177,36 @@ test('without a Satellites action the exit restores the pre-mission visibility',
['enabled', 'satellites', false],
]);
});
test('a Satellites layer that does not settle keeps the saved state for the next exit', async () => {
const r = satelliteRig({ enabledBefore: false });
let idle = false;
r.state._dataManager.waitForLayerIdle = async () => idle;
await assert.rejects(
r.ingestion.restoreSatelliteDependency(),
/did not settle/,
);
assert.deepEqual(r.calls, [], 'nothing changes while Satellites is busy');
assert.deepEqual(r.state._satelliteStateBeforeMission, {
enabled: false,
params: { mode: 'before' },
});
// Turning Space Missions off again once Satellites settles finishes it.
idle = true;
await r.ingestion.restoreSatelliteDependency();
assert.deepEqual(r.calls, [
['params', 'satellites', { mode: 'before' }],
['enabled', 'satellites', false],
]);
assert.equal(r.state._satelliteStateBeforeMission, null);
});
test('a Satellites action the person took still gets its parameters back when Satellites is busy', async () => {
const r = satelliteRig({ enabledBefore: false });
r.state._dataManager.waitForLayerIdle = async () => false;
r.state._satelliteStateBeforeMission.restoreVisibility = false;
await r.ingestion.restoreSatelliteDependency();
assert.deepEqual(r.calls, [['params', 'satellites', { mode: 'before' }]]);
assert.equal(r.state._satelliteStateBeforeMission, null);
});