fix(launches): preserve unknown payload details

This commit is contained in:
onionviolet committed 2026-09-10 23:29:55 -04:00
1 parent 5067abfe9b
commit a4b6dbb41f
4 files changed
+22 -3

No files matched your search

+2
View File
@@ -6,6 +6,8 @@ Earthquake refreshes validate the complete feed and construct replacement entiti
Non-object or array-valued properties reject the response instead of being treated as an unknown magnitude.
Launch payloads with missing records now say PAYLOAD DATA UNAVAILABLE. Missing names use Unnamed payload; absent or invalid mass stays unknown instead of appearing as 0 KG.
This changelog records public product changes. For the authoritative description
of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md).
+2
View File
@@ -6,6 +6,8 @@ Earthquake refreshes validate the complete feed and construct replacement entiti
Non-object or array-valued properties reject the response instead of being treated as an unknown magnitude.
Launch payloads with missing records now say PAYLOAD DATA UNAVAILABLE. Missing names use Unnamed payload; absent or invalid mass stays unknown instead of appearing as 0 KG.
Updated: August 24, 2026
## Installations and map-source guidance
+5 -3
View File
@@ -2106,13 +2106,15 @@ function normalizePayloadFlights(launch) {
const payload = flight.payload || flight;
return {
id: String(flight.id || payload.id || `payload-${index}`),
name: payload.name || flight.name || 'Undisclosed payload',
name: payload.name || flight.name || 'Unnamed payload',
type: payload.type?.name || flight.type?.name || null,
manufacturer: payload.manufacturer?.name || null,
operator: payload.operator?.name || null,
destination: flight.destination || payload.destination || null,
amount: Number.isFinite(Number(flight.amount)) ? Number(flight.amount) : 1,
massKg: Number.isFinite(Number(payload.mass)) ? Number(payload.mass) : null,
massKg: (typeof payload.mass === 'number' || (typeof payload.mass === 'string' && payload.mass.trim() !== ''))
&& Number.isFinite(Number(payload.mass)) && Number(payload.mass) >= 0
? Number(payload.mass) : null,
};
});
}
@@ -2288,7 +2290,7 @@ function renderMissionPanel() {
_missionPanel.querySelector('[data-mission-payloads]').innerHTML = missionTableRows(
payloadRows,
3,
'CLASSIFIED / MULTI-PAYLOAD',
'PAYLOAD DATA UNAVAILABLE',
);
const stageRows = launch.recoveryStages.map((stage) => {
const endpoint = stage.endpoint;
+13
View File
@@ -1253,3 +1253,16 @@ test('disable reports a semantic failure while restoring the satellites dependen
/could not restore the satellites layer/,
);
});
test('missing payload details stay unknown without inventing mass or classification', () => {
for (const [mass, expected] of [[null, null], [undefined, null], ['', null], [' ', null],
[false, null], [-1, null], ['invalid', null], [0, 0], ['125', 125]]) {
const [launch] = normalizeRocketLaunches([{ id: 'mass', pad: { latitude: 1, longitude: 2 }, net: '2026-07-20T10:00:00Z',
payloads: [{ mass }] }], NOW);
assert.equal(launch.payloads[0].massKg, expected);
assert.equal(launch.payloads[0].name, 'Unnamed payload');
}
const [launch] = normalizeRocketLaunches([{ id: 'missing', pad: { latitude: 1, longitude: 2 }, net: '2026-07-20T10:00:00Z' }], NOW);
assert.deepEqual(launch.payloads, []);
});