Skip to content

Bug: Label_H1_ATIS captures the message sequence number but drops it on the floor — raw.sequence_number never set, dedup impossible downstream #504

Description

@kevinelliott

Summary

Label_H1_ATIS regex captures group 1 = (\d{2}) for the ATIS message sequence number. The value is bound to const seq = match[1] and then never used — every other captured group (flight, facility, code, airport, checksum) becomes a raw/formatted field. Callers who need the sequence number to dedupe repeated ATIS deliveries (or to render it, mirroring ResultFormatter.sequenceNumber in QQ/QR/etc.) never see it.

Location

lib/plugins/Label_H1_ATIS.ts:23-53

const regex =
  /^L(\d{2})A([A-Z0-9]+)\/([A-Z]{4})\.TI2\/(\d{3})([A-Z]{4})([A-F0-9]+)$/;

const seq      = match[1];        // <- captured
const flight   = match[2];
const facility = match[3];
const code     = match[4];
const airport  = match[5];
const checksum = match[6];

ResultFormatter.flightNumber(decodeResult, flight);
ResultFormatter.arrivalAirport(decodeResult, facility);
// `seq` never referenced again

Reproduction

Any input the regex matches, e.g.

new MessageDecoder().decode({ label: 'H1', text: 'L02AAA123/EGKK.TI2/123EGKKA1B2' });
// raw.sequence_number === undefined
// formatted.items has no SEQ_NUM entry

Impact

Minor — a missing field. Notable because the value is right there in the regex captures.

Suggested fix

Push seq through ResultFormatter.sequenceNumber (or the equivalent used elsewhere), so both raw.sequence_number and a formatted.items entry are populated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions