Skip to content

Add Label 3L Position decoder plugin (Jetstar)#401

Open
thepacket wants to merge 1 commit into
airframesio:masterfrom
thepacket:plugin/label-3l
Open

Add Label 3L Position decoder plugin (Jetstar)#401
thepacket wants to merge 1 commit into
airframesio:masterfrom
thepacket:plugin/label-3l

Conversation

@thepacket

Copy link
Copy Markdown

Adds a decoder for the slash-delimited lat/lon/UTC label-3L position report.

Wire format

N 12.345 / E 123.456 / UTC 1430

npm run build passes.

New plugin registered in official.ts and MessageDecoder.ts.
@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown

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 41 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 41 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: 6f2e02b6-7293-42a3-a1b5-6bd357bd5a20

📥 Commits

Reviewing files that changed from the base of the PR and between 10f9f69 and 76dbfce.

📒 Files selected for processing (3)
  • lib/MessageDecoder.ts
  • lib/plugins/Label_3L_Position.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.

@kevinelliott kevinelliott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 in lib/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 set remaining.text, so the unparsed message is dropped silently. Use this.failUnknown(decodeResult, message.text, options) (see Label_15.ts).

Should Fix

  • Use ResultFormatter.timestamp(...) instead of a custom Time chip. You currently set decodeResult.raw.message_timestamp manually and then push a separate {type:'time', code:'TIME'} chip with ${hh}:${mm} UTC. The canonical helper does both in one call and emits code:'TIMESTAMP' consistent with the rest of the codebase.
  • HHMM range validation. (?<time>\d{4}) accepts 9999. Validate hh < 24 && mm < 60 before converting.
  • Duplicate position information. ResultFormatter.position(...) already pushes a chip (code:'POS') and writes raw.position. The extra LAT / LON chips with ${lat}° South (latitude) are a UI duplicate. If you want hemisphere-explicit display, consider doing it via CoordinateUtils or omitting the extra chips.

Nits

  • The Direction chip (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 it raw-only, since direction is implicit from the label/position schema).
  • Message Type chip duplicates formatted.description — noise.
  • The plugin description in initResult is just 'Position Report', but the chip you push says 'Position Report (Jetstar 3L — lat/lon + UTC)'. Consider consolidating: pass the more specific string to initResult and drop the chip, or vice versa.

Tests

Missing — please add Label_3L_Position.test.ts.

Notes

  • Registration: confirmed in lib/MessageDecoder.ts and lib/plugins/official.ts. Good.

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