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

+9 -6
View File
@@ -179,18 +179,21 @@ export function createIngestion({
layerState._satelliteStateBeforeMission !== snapshot
)
return;
// An accepted Satellites action owns visibility through mission teardown.
const restoreVisibility = snapshot.restoreVisibility !== false;
// Satellites is still busy: change nothing and keep the saved state, so
// turning Space Missions off again can finish the restore.
if (restoreVisibility && !idle)
throw new Error(
'Space Missions could not restore the satellites layer: it did not settle',
);
layerState._satelliteStateBeforeMission = null;
layerState._satelliteActivationPromise = null;
manager.setLayerParams(
'satellites',
parts.policyHelpers.satelliteParamsAfterSpaceMissions(snapshot.params),
);
// An accepted Satellites action owns visibility through mission teardown.
if (snapshot.restoreVisibility === false) return;
if (!idle)
throw new Error(
'Space Missions could not restore the satellites layer: it did not settle',
);
if (!restoreVisibility) return;
const restored = await manager.setEnabled('satellites', snapshot.enabled);
if (
restored === false ||