Skip to content

Fix repeated records in ANPP decoders - #22

Merged
mattia-adnav merged 1 commit into
advanced-navigation:masterfrom
mark-lawrenson:codex/fix-anpp-repeated-record-decoding
Aug 25, 2026
Merged

mattia-adnav merged 1 commit into
advanced-navigation:masterfrom
mark-lawrenson:codex/fix-anpp-repeated-record-decoding

Conversation

@mark-lawrenson

@mark-lawrenson mark-lawrenson commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

Several packet decoders initialise record lists using [Record()] * count. Every item then refers to the same object, so decoding overwrites the earlier records and returns the final record multiple times. This affects Packets 31, 60, 84, 181, and 202.

The existing Log.anpp fixture shows the problem: Packet 202 contains four different ports, but the current decoder returns four copies of the final port. Packet 181 does the same with its two period records.

Change

  • Create an independent object for each repeated record.
  • Accumulate all preceding Packet 60 frequency records when calculating the next satellite offset.

Tests

The regression tests cover each affected record list and Packet 60 satellite
data with frequency counts of 2, 1, and 2. All 290 tests pass.

@mark-lawrenson
mark-lawrenson force-pushed the codex/fix-anpp-repeated-record-decoding branch from 77ea7d4 to b90f9ae Compare July 22, 2026 11:00
@mark-lawrenson mark-lawrenson changed the title Fix repeated-record corruption in ANPP decoders Fix repeated records in ANPP decoders Jul 22, 2026

@mattia-adnav mattia-adnav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for reporting and fixing this issue!
Please rebase and look at the other comments.

Comment thread tests/anpp_packets_tests/test_repeated_record_decoding.py Outdated
Comment thread tests/anpp_packets_tests/test_repeated_record_decoding.py Outdated
Comment thread tests/anpp_packets_tests/test_repeated_record_decoding.py
@mark-lawrenson
mark-lawrenson force-pushed the codex/fix-anpp-repeated-record-decoding branch from b90f9ae to 7285418 Compare August 25, 2026 03:23
@mark-lawrenson

mark-lawrenson commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @mattia-adnav! I have rebased onto master, updated both copyright years, and ran ruff check . --fix. :)

@mattia-adnav
mattia-adnav merged commit 9fb9089 into advanced-navigation:master Aug 25, 2026
5 checks passed
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