Add Label 52 AGM (Ground UTC Request) decoder plugin#403
Add Label 52 AGM (Ground UTC Request) decoder plugin#403thepacket 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 38 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 Label_52_AGM for a ground-to-air UTC request uplink, decoding the leading YYMMDD calendar-date fields and intentionally leaving the trailing portion unparsed. Registers in MessageDecoder.ts and lib/plugins/official.ts.
Verdict
Tight, conservative scope and the date validation is the strongest in this batch. Main gap is the missing test. A couple of consistency items below.
Must Fix
- No companion
Label_52_AGM.test.ts. Every plugin inlib/plugins/has a Jest test file. Please add one — at minimum, the2604201091039example, plus negative cases (<6chars, invalid month13, invalid day32). - Trailing payload is dropped. The PR description correctly notes the trailing
1091039is undocumented and intentionally not parsed — but right now it disappears from the result entirely. Convention is to surface it viaResultFormatter.unknown(decodeResult, text.substring(6))ordecodeResult.remaining.text = text.substring(6)so downstream consumers can still see it. Otherwise you've gone fromdecoded:false(with text preserved) todecoded:true(with text silently dropped), which is worse for diagnostics.
Should Fix
- Use
ResultFormatter.month(...)andResultFormatter.day(...).result_formatter.ts:440and:450provide canonical helpers withcode:'MSG_DAY'/code:'MSG_MON'and proper raw fields. Your custom chips (code:'YEAR',code:'MONTH',code:'DAY') work but diverge from convention. The stringified"04 (April)"value is helpful display; consider keeping a pretty chip in addition to the canonical one, or moving "April" into raw and letting the consumer format. raw.yearandraw.datearen't inRawFields(allowed by index signature).RawFields.monthandRawFields.dayexist as numbers — your assignment matches that. ISOraw.dateis plugin-specific; fine, but document that it's a derived convenience field.- Day-per-month validation.
dayN <= 31allows e.g. February 30. Probably fine for an opportunistic decoder; flag if you want stricter validation.
Nits
- The
Directionchip (Uplink (ground → aircraft)) is non-standard and not used elsewhere — consider dropping or moving to raw only. Message Typechip duplicatesformatted.description.
Tests
Missing — please add Label_52_AGM.test.ts.
Notes
- Registration: confirmed in
lib/MessageDecoder.tsandlib/plugins/official.ts. Good. - HHMM/anchor validation here is the cleanest of the five PRs in this series — nice.
Thanks @thepacket!
Adds a decoder for label 52 Ground UTC Request uplinks. Only the three confirmed fields (YY, MM, DD) are surfaced; the trailing time/status portion is undocumented and intentionally ignored.
Wire format
npm run buildpasses.