fix(satellites): classes read every group a TLE came in, and current SATCAT

Deduplication kept only the first group's tag, so a recent imaging
satellite in both visual and resource, with no UCS record or known name,
fell to Probes. The catalog entry now keeps every group, and the
last-resort class is the first of them that names one.

SATCAT groups merged in group order, so a stale cached copy read later
overwrote a current record of the same object: a satellite SATCAT now
calls dead stayed in Imaging. A stale copy no longer overrules a current
read, from the same merge or an earlier one.
This commit is contained in:
Sameh Khamis committed 2026-11-08 15:16:01 -08:00
1 parent c84cfcadeb
commit 8bd16b0be9
3 files changed
+87 -9

No files matched your search

+10 -2
View File
@@ -147,10 +147,14 @@ function launchYearOf(launchDate) {
/**
* The class a satellite belongs to.
* @param {{noradId?: number, name?: string, group?: string|null,
* groups?: string[]|null,
* ucs?: {purpose?: string|null}|null,
* satcat?: {objectType?: string, opsStatus?: string,
* launchDate?: string|null}|null,
* launchYear?: number|null, nowYear?: number}} subject `launchYear` is
* launchYear?: number|null, nowYear?: number}} subject `groups` is every
* CelesTrak group the TLE came in (`group` is the one it is shown under):
* the first of them that names a class gives the last-resort class, so a
* satellite in both `visual` and `resource` is still imaging. `launchYear` is
* the TLE designator's; SATCAT's launch date wins where it has one (an
* object deployed from the ISS carries the station's 1998 designator).
* @returns {'stations'|'imaging'|'telecom'|'starlink'|'probes'|'debris'}
@@ -161,6 +165,7 @@ export function classifySatellite({
group = null,
ucs = null,
satcat = null,
groups = null,
launchYear = null,
nowYear = new Date().getUTCFullYear(),
} = {}) {
@@ -199,7 +204,10 @@ export function classifySatellite({
)
return 'debris';
return GROUP_CLASS[group] || 'probes';
const memberships = groups?.length ? groups : [group];
for (const membership of memberships)
if (GROUP_CLASS[membership]) return GROUP_CLASS[membership];
return 'probes';
}
/** Whether a class may be ridden in the Cockpit's orbital view. */