Skip to content

fix(Label_H1_ATIS): populate sequence_number from captured seq group - #505

Open
fuleinist wants to merge 1 commit into
airframesio:masterfrom
fuleinist:fix/atis-sequence-number
Open

fix(Label_H1_ATIS): populate sequence_number from captured seq group#505
fuleinist wants to merge 1 commit into
airframesio:masterfrom
fuleinist:fix/atis-sequence-number

Conversation

@fuleinist

@fuleinist fuleinist commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Closes #504.

The regex in Label_H1_ATIS.decode() captures a 2-digit sequence number in group 1 but the value was never passed through to ResultFormatter.sequenceNumber(). This meant
aw.sequence_number was always undefined, preventing downstream dedup of repeated ATIS deliveries.

Changes

  • lib/plugins/Label_H1_ATIS.ts — call ResultFormatter.sequenceNumber(decodeResult, parseInt(seq, 10)) after the existing lightNumber/�rrivalAirport calls
  • lib/plugins/Label_H1_ATIS.test.ts — assert
    aw.sequence_number === 95 on the KSFO test case

Test

s expect(decodeResult.raw.sequence_number).toBe(95);

All existing tests pass.

Summary by CodeRabbit

  • Bug Fixes
    • ATIS messages now correctly include their sequence number in decoded results.
  • Tests
    • Added coverage to verify sequence numbers are decoded correctly.

The regex captures a 2-digit sequence number in group 1 but the value
was never passed through to ResultFormatter.sequenceNumber(). This
meant raw.sequence_number was always undefined, preventing downstream
dedup of repeated ATIS deliveries.

Closes airframesio#504
Copilot AI review requested due to automatic review settings July 30, 2026 16:10
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c6b1bf3-6f66-441d-916f-4be06d8daa76

📥 Commits

Reviewing files that changed from the base of the PR and between cdb52c8 and 0c86b1f.

📒 Files selected for processing (2)
  • lib/plugins/Label_H1_ATIS.test.ts
  • lib/plugins/Label_H1_ATIS.ts

Walkthrough

Label_H1_ATIS.decode() now parses the captured ATIS sequence number and stores it in the result; the KSFO test verifies the value is 95.

Changes

ATIS sequence number

Layer / File(s) Summary
Decode and validate sequence number
lib/plugins/Label_H1_ATIS.ts, lib/plugins/Label_H1_ATIS.test.ts
The decoder formats the captured sequence number as an integer, and the test verifies raw.sequence_number equals 95.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: copilot

Poem

I’m a rabbit with numbers to share,
Now ATIS keeps its sequence with care.
Ninety-five hops into view,
The decoder knows what to do.
No more lost digits in the air!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the main change: populating sequence_number from the captured seq group.
Linked Issues check ✅ Passed The code now passes the captured sequence number to ResultFormatter.sequenceNumber and adds a test for raw.sequence_number.
Out of Scope Changes check ✅ Passed The only changes are the targeted decoder fix and a corresponding test, with no unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

Copilot AI 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.

🟢 Ready to approve

The change correctly wires the already-captured sequence number into the existing formatter API and adds a targeted test assertion to prevent regression.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR fixes Label_H1_ATIS.decode() to actually propagate the 2-digit ATIS sequence number captured by the regex into the decoded result, enabling downstream deduplication via raw.sequence_number.

Changes:

  • Populate decodeResult.raw.sequence_number (and the corresponding formatted item) by calling ResultFormatter.sequenceNumber(...) with the captured seq.
  • Extend the KSFO ATIS subscription test to assert the expected raw.sequence_number value.
File summaries
File Description
lib/plugins/Label_H1_ATIS.ts Passes the captured ATIS sequence group through ResultFormatter.sequenceNumber so raw.sequence_number is set.
lib/plugins/Label_H1_ATIS.test.ts Adds an assertion to verify the KSFO sample decodes raw.sequence_number as expected.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Low

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

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.

Bug: Label_H1_ATIS captures the message sequence number but drops it on the floor — raw.sequence_number never set, dedup impossible downstream

2 participants