Skip to content

Trimming Label MA tail#320

Merged
makrsmark merged 2 commits intoairframesio:masterfrom
makrsmark:bugfix/label-ma-tail
Feb 5, 2026
Merged

Trimming Label MA tail#320
makrsmark merged 2 commits intoairframesio:masterfrom
makrsmark:bugfix/label-ma-tail

Conversation

@makrsmark
Copy link
Collaborator

@makrsmark makrsmark commented Feb 3, 2026

adding another spec

Summary by CodeRabbit

  • Bug Fixes

    • Fixed tail value formatting by removing unnecessary characters for cleaner display.
    • Improved data merging behavior in decode operations for better accuracy.
  • Tests

    • Added comprehensive test coverage for decode scenarios.
    • Updated test assertions for improved validation accuracy.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Warning

Rate limit exceeded

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

⌛ 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.

Walkthrough

The Label_MA plugin's tail handling logic is modified to sanitize dots from tail values before formatting. Additionally, the merge order of raw decode results is reversed to change property precedence. Tests are updated to reflect the new tail formatting behavior and a new decode scenario is validated.

Changes

Cohort / File(s) Summary
Tail sanitization & decode merge
lib/plugins/Label_MA.ts
Modified tail handling to remove dots via sanitization before formatting; reversed merge order of decoded.raw and decodeResult.raw to prioritize decoded values.
Test updates & new scenario
lib/plugins/Label_MA.test.ts
Updated expected tail values in existing tests by removing leading dots (.F-HREVF-HREV; .ET-BAYET-BAY); added new test case to validate full decode scenario with multiple raw field assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • kevinelliott
  • andermatt64

Poem

🐰 A dot, a dash, a sanitized tail,
Reordered merges tip the scale,
Tests now validate the flow so bright,
MA decoding shines with cleaner sight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Trimming Label MA tail' accurately describes the main change: sanitizing the tail field by removing dots in the Label_MA plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

adding another spec
@makrsmark makrsmark force-pushed the bugfix/label-ma-tail branch from d05a12b to 12604cb Compare February 3, 2026 12:56
test('decodes twice', () => {
const text = "T20!<<,B/k&,Z:/=Hs!'iLt0/1h8|*KJNa__;Kes\"hV'&4]J&&&;\"X/O6%0d7TMg5=d7'gcZ:j\"2EiA7k`-`$]f/<L\\63L-&,<Pi[2<O9p^t+Khl*&\\e^,*%4:H<-9Lm>r>q-b^jGP>WX4Dk3IrQ:U4%?]H$4HCd0Z(^Yq+lXXR!=niT!#;:5UAQ`JU@Bfn/*)TSu?G=LuOlLaFSmkGi]eE[!o&j@iX^g0r)T9!Ye)k6aOmSf`8G)8,hS5Fq_trW*!!";
// decodes to label 80
// 3D01 RMPSRV 2501/02 LEMD/MMUN .EC-NOI\n/LAV Y/CAB Y/MEDA N/SEC N/WAS N/WAT N/FUEL N/WCHRR 01/WCHRS --/WCHRC --/UMNR --/MAAS N\nBUENAS NOCHES, ETA 0055Z Y NOS HAN PEDIDO UNA WCHR QUE AL PARECER NO TENIAMOS CONSTANCIA DE ELLA, POR SI PODEIS PEDIRLO A OPS CUN. MUCHAS GRACIAS
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do we want this message stored somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

put the remaining parts in remaining

expect(decodeResult.raw.departure_icao).toBe('LEMD');
expect(decodeResult.raw.arrival_icao).toBe('MMUN');
expect(decodeResult.raw.day).toBe(2);
expect(decodeResult.formatted.items.length).toBe(7); // Tail twice
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I should probably have an if tail exists, don't add again - but i don't want to

don't show text if not fully decoded
@makrsmark makrsmark merged commit e587c54 into airframesio:master Feb 5, 2026
6 checks passed
@makrsmark makrsmark deleted the bugfix/label-ma-tail branch February 5, 2026 12:44
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.

1 participant