Add Label B9 ATIS Request decoder plugin#414
Add Label B9 ATIS Request decoder plugin#414thepacket wants to merge 1 commit intoairframesio:masterfrom
Conversation
New plugin registered in official.ts and MessageDecoder.ts.
|
Warning Rate limit exceeded
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 19 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
kevinelliott
left a comment
There was a problem hiding this comment.
Summary
Adds a new Label_B9_ATIS_Request plugin for label B9 D-ATIS request downlinks (/ICAO.TI2/SEQ ICAO LETTER SUBQ CHK). Registers it last in MessageDecoder.ts/official.ts. No companion test file.
Verdict
Comment-only review — needs changes before merge. The decoding logic is reasonable and self-contained, but there are no tests, no preamble qualifier (so the plugin runs against every B9 message even when it can't apply), and a couple of small data-model concerns.
Must Fix
- Add a
Label_B9_ATIS_Request.test.ts. Every other label plugin in this directory has one and the project's review checklist explicitly flags missing tests. At minimum:qualifiers()shape, a happy-path decode for/EDDK.TI2/024EDDKA661A, the partial-header fallback, and a non-matching string. - Restrict the qualifier to a real preamble. Right now
qualifiers()returnslabels: ['B9']only — every B9 message is run through this regex even when it's clearly not a TI2 request. Addpreambles: ['/'](every observed shape begins with/) so the dispatcher can short-circuit. This is consistent with peers likeLabel_H1_Paren(preambles: ['(']).
Should Fix
raw.arrival_icao = gsis semantically wrong. A B9 ATIS request targets a ground-station ATIS service — that station may or may not be the flight's arrival airport. Storing it underarrival_icaowill pollute downstream consumers that aggregate by destination. Drop it; you already exposeground_station_icaoand the top-level airport item undercode: 'GNDSTN'. Same applies to the partial-header fallback path (line 67).decodeResult.formatted.items = [...](line 111) replaces the array. It happens to be empty here becauseinitResult()doesn't push anything, but the convention everywhere else in the codebase isitems.push(...). Switching avoids a subtle footgun ifinitResultis ever extended.raw.checksumis typednumberinRawFieldsbut you assign a string.chkis[A-Z0-9]{2,4}, e.g."661A". Either assign it under a different key (raw.atis_checksum_hex) or convert viaparseInt(chk, 16). Today this just relies on the index signature falling through, but it'll trip up anyone reading types.
Nits
- The phonetic table is fine, but it's effectively a const map — pulling it out of the class avoids reallocating on every decode (cosmetic only).
- "differs from header" / "echoes target" annotation embedded in the value string is friendly but mixes data and presentation — fine for now, just be aware it makes programmatic comparison harder.
- The 2–4 char checksum window is wide; if you have a sample showing variable widths it would be nice to capture in a comment so future maintainers don't tighten it accidentally.
Tests
None added. Please add Label_B9_ATIS_Request.test.ts covering at minimum:
qualifiers()shape (will need to be updated after adding the/preamble)- Happy path (
/EDDK.TI2/024EDDKA661A) — assert tail/letter/subq/checksum and the items array - Partial-header fallback (
/EDDK.TI2/...garbage) - Non-matching string returns
decoded: false
Notes — Registration & Coexistence
- Registered at the tail of
pluginClassesinMessageDecoder.ts(afterLabel_QQ) and exported fromofficial.ts. No other plugin claims label B9, so order is irrelevant. - No coexistence concerns.
Thanks @thepacket!
Adds a decoder for label B9 D-ATIS requests (request for ATIS broadcast).
npm run buildpasses.