Add Label 3L Position decoder plugin (Jetstar)#401
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 41 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_3L_Position for a slash-delimited lat/lon/UTC position downlink (Jetstar variant). Registers in MessageDecoder.ts and lib/plugins/official.ts.
Verdict
Small, focused plugin. Regex anchoring is correct and the hemisphere handling is right. A handful of convention items below.
Must Fix
- No companion
Label_3L_Position.test.ts. Every plugin inlib/plugins/ships a Jest test file. Please add one with the example wire format from the description plus a couple of negative cases (missing UTC token, malformed hemisphere). - Lossy fall-through. When the regex doesn't match, you call
setDecodeLevel(false)but never setremaining.text, so the unparsed message is dropped silently. Usethis.failUnknown(decodeResult, message.text, options)(seeLabel_15.ts).
Should Fix
- Use
ResultFormatter.timestamp(...)instead of a custom Time chip. You currently setdecodeResult.raw.message_timestampmanually and then push a separate{type:'time', code:'TIME'}chip with${hh}:${mm} UTC. The canonical helper does both in one call and emitscode:'TIMESTAMP'consistent with the rest of the codebase. - HHMM range validation.
(?<time>\d{4})accepts9999. Validatehh < 24 && mm < 60before converting. - Duplicate position information.
ResultFormatter.position(...)already pushes a chip (code:'POS') and writesraw.position. The extraLAT/LONchips with${lat}° South (latitude)are a UI duplicate. If you want hemisphere-explicit display, consider doing it viaCoordinateUtilsor omitting the extra chips.
Nits
- The
Directionchip (Downlink (aircraft → ground)) is non-standard and not used elsewhere in the codebase. Other position plugins don't emit a direction chip; consider removing it (or making itraw-only, since direction is implicit from the label/position schema). Message Typechip duplicatesformatted.description— noise.- The plugin description in
initResultis just'Position Report', but the chip you push says'Position Report (Jetstar 3L — lat/lon + UTC)'. Consider consolidating: pass the more specific string toinitResultand drop the chip, or vice versa.
Tests
Missing — please add Label_3L_Position.test.ts.
Notes
- Registration: confirmed in
lib/MessageDecoder.tsandlib/plugins/official.ts. Good.
Thanks @thepacket!
Adds a decoder for the slash-delimited lat/lon/UTC label-3L position report.
Wire format
npm run buildpasses.