Skip to content

Add Label 5Z AA/US Airways Variant 1 decoder plugin#405

Open
thepacket wants to merge 1 commit intoairframesio:masterfrom
thepacket:plugin/label-5z
Open

Add Label 5Z AA/US Airways Variant 1 decoder plugin#405
thepacket wants to merge 1 commit intoairframesio:masterfrom
thepacket:plugin/label-5z

Conversation

@thepacket
Copy link
Copy Markdown

Adds a decoder for American Airlines / US Airways label 5Z 'OS' downlinks (Variant 1 — Airline Designated Downlink).

Wire format

OS KMSN /IR KMSN2209          ← in-range with ETA
OS KPHX /CLR                  ← clear
OS KDFW/ALT00001930           ← altimeter + ETA
OS KAUS/FTM\r\nLAST MINUTE REQ… ← free-text with crew request body

Coexists with existing Label_5Z_Slash (United Airlines variant) via leading-/ guard.

npm run build passes.

New plugin registered in official.ts and MessageDecoder.ts.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@thepacket has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 36 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 55 minutes and 36 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4f521e9e-07f3-4533-b215-f135d92736d0

📥 Commits

Reviewing files that changed from the base of the PR and between 10f9f69 and 89091c8.

📒 Files selected for processing (3)
  • lib/MessageDecoder.ts
  • lib/plugins/Label_5Z_AA.ts
  • lib/plugins/official.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@kevinelliott kevinelliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds a Label_5Z_AA plugin for AA/US Airways "OS" downlinks (in-range, clear, ALT-altimeter, FTM free-text). Coexists with the existing United Label_5Z_Slash via an explicit text.startsWith('/') early-out. Registered in MessageDecoder.ts and official.ts.

Verdict

Changes requested — no tests, plus a couple of consistency / dispatch concerns.

Must Fix

  • No tests. Please add coverage for the four documented shapes: OS KPHX /CLR, OS KSFO /IR KSFO0312, OS KDFW/ALT00001930, and an OS KAUS/FTM\r\nLAST MINUTE REQ… free-text. Include a negative test for /-prefixed messages so the United routing can't regress.
  • subCommandDescriptions mis-labels several entries. OUT/OFF/ON/IN are listed under "subcommand", but those are themselves separate ARINC label-44 movement events; they are not known sub-codes for the AA OS variant in the body. Either document the actual AA observed list (IR/CLR/ALT/FTM) and drop the rest, or cite the source. As-is the table will mislead consumers.

Should Fix

  • Coexistence with Label_5Z_Slash is fragile. Both plugins now register labels: ['5Z']. Label_5Z_Slash filters with preambles: ['/'], but Label_5Z_AA has no preamble qualifier — so for /-prefixed messages it still runs (and self-rejects via text.startsWith('/')). Cleaner: add a preamble qualifier to exclude /, or invert it (preambles: ['OS ']). This also lets the framework skip you faster on non-OS 5Z traffic.
  • Duplicate / non-standard time keys. You set both raw.estimated_arrival_time (a HH:MM string) and raw.eta_time (via ResultFormatter.eta, seconds-since-midnight). Pick one; the seconds-of-day form is the convention used elsewhere.
  • raw.altimeter_raw is unusual. If it’s genuinely raw/unparsed, prefer remaining.text or omit. The "may be padding" comment suggests this should not be exposed unless meaningful.
  • HHMM range validation. convertHHMMSSToTod(time + '00') does no bounds check — 2599 would silently produce a wrong TOD. Validate hh < 24 && mm < 60 before calling, consistent with other plugins.
  • raw.airline = 'American Airlines / US Airways' as a single combined string is a bit lossy — the format also describes "AA Variant 1" but stores both carrier names jointly. If known, use IATA/ICAO carrier code(s) per the message header, or split.

Nits

  • freeText is built by joining bodyLines with \n after stripping \r — make sure the test for FTM checks both \r\n and \n separators don't break the match.
  • m.groups destructuring with altIcao || timeA … is fine but a small jsdoc on the regex would help future maintainers (the alternatives are dense).
  • "Out-Safe" is an unusual gloss for "OS" — Operational Status is by far the more common reading. Consider dropping the "Out-Safe" parenthetical.

Tests

Missing. See Must Fix.

Notes

  • Registration LGTM (added to MessageDecoder pluginClasses and re-exported via official.ts).
  • CodeRabbit hit a rate limit and did not actually review; the warning can be ignored.

Thanks @thepacket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants