mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix(launches): preserve unknown payload details
This commit is contained in:
1 parent
5067abfe9b
commit
a4b6dbb41f
4 files changed
+22
-3
No files matched your search
@@ -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.
|
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
|
This changelog records public product changes. For the authoritative description
|
||||||
of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md).
|
of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md).
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
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
|
Updated: August 24, 2026
|
||||||
|
|
||||||
## Installations and map-source guidance
|
## Installations and map-source guidance
|
||||||
|
|||||||
@@ -2106,13 +2106,15 @@ function normalizePayloadFlights(launch) {
|
|||||||
const payload = flight.payload || flight;
|
const payload = flight.payload || flight;
|
||||||
return {
|
return {
|
||||||
id: String(flight.id || payload.id || `payload-${index}`),
|
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,
|
type: payload.type?.name || flight.type?.name || null,
|
||||||
manufacturer: payload.manufacturer?.name || null,
|
manufacturer: payload.manufacturer?.name || null,
|
||||||
operator: payload.operator?.name || null,
|
operator: payload.operator?.name || null,
|
||||||
destination: flight.destination || payload.destination || null,
|
destination: flight.destination || payload.destination || null,
|
||||||
amount: Number.isFinite(Number(flight.amount)) ? Number(flight.amount) : 1,
|
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(
|
_missionPanel.querySelector('[data-mission-payloads]').innerHTML = missionTableRows(
|
||||||
payloadRows,
|
payloadRows,
|
||||||
3,
|
3,
|
||||||
'CLASSIFIED / MULTI-PAYLOAD',
|
'PAYLOAD DATA UNAVAILABLE',
|
||||||
);
|
);
|
||||||
const stageRows = launch.recoveryStages.map((stage) => {
|
const stageRows = launch.recoveryStages.map((stage) => {
|
||||||
const endpoint = stage.endpoint;
|
const endpoint = stage.endpoint;
|
||||||
|
|||||||
@@ -1253,3 +1253,16 @@ test('disable reports a semantic failure while restoring the satellites dependen
|
|||||||
/could not restore the satellites layer/,
|
/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, []);
|
||||||
|
});
|
||||||
Reference in new issue
Block a user