fix(flights): class an aircraft by its feed's type from the first fix

A civil aircraft was drawn as an airliner until its type lookup answered,
even when its feed already named the type: a helicopter showed the
airliner icon and model for as long as the lookup took.

- Flights classes every contact, and picks its model, by the feed's own
  ICAO type designator from the first fix. A looked-up type replaces it
  once the lookup answers and outranks the feed's on every later poll;
  the lookup still runs and fills the type name and registration.
- A surface emitter category still keeps only a ground type (ZVEH, GRND)
  from the feed.
- State vectors have no type field, so an /api/flights answer may send
  `typeByIcao` beside them, by ICAO address, as `emergencyByIcao` is sent.
  The regional adsb.lol fallback now sends it from each row's `t`.
This commit is contained in:
Sameh Khamis committed 2026-11-17 17:37:48 -08:00
1 parent 2f0c01eaa7
commit f2537743ab
9 files changed
+205 -24

No files matched your search

+5 -1
View File
@@ -156,7 +156,11 @@ export function createEnrichment({
(data) => {
const meta = flightState.records.data.get(icao24);
if (!meta) return; // evicted while the lookup was in flight
meta.typeCode = data.typeCode || meta.typeCode;
// A looked-up type outranks the feed's own from now on.
if (data.typeCode) {
meta.typeCode = data.typeCode;
meta.typeLookedUp = true;
}
meta.typeName = data.typeName || meta.typeName;
meta.registration = data.registration || meta.registration;
if (meta.typeCode) {