Skip to content

StatefulModeSDecoder: only decode valid positions#35

Merged
mrksngl merged 2 commits intomainfrom
32-pos-validity
Mar 2, 2026
Merged

StatefulModeSDecoder: only decode valid positions#35
mrksngl merged 2 commits intomainfrom
32-pos-validity

Conversation

@fixje
Copy link
Copy Markdown
Contributor

@fixje fixje commented Feb 27, 2026

Using the StatefulModeSDecoder alone without any (external) extensions,
this is not a problem: a position is not valid if and only if it
originates from a FTC=0 message (following the implementation of all
PositionMessages, this is the definition of hasValidPosition) . However,
that decoder "discards" those messages (or rather: does not decode
them), thus a "invalid position" messages never makes it to the
erroneous control flow.
However, if such FTC=0 messages are manually handled, they resolve into
classes implementing interface PositionMsg and can then be fed into
extractPosition from where we go down the described path.

Fixes #32

fixje added 2 commits March 2, 2026 14:25
Using the StatefulModeSDecoder alone without any (external) extensions,
this is not a problem: a position is not valid if and only if it
originates from a FTC=0 message (following the implementation of all
PositionMessages, this is the definition of hasValidPosition) . However,
that decoder "discards" those messages (or rather: does not decode
them), thus a "invalid position" messages never makes it to the
erroneous control flow.
However, if such FTC=0 messages are manually handled, they resolve into
classes implementing interface PositionMsg and can then be fed into
extractPosition from where we go down the described path.
@fixje fixje force-pushed the 32-pos-validity branch from 6959b57 to 3958a37 Compare March 2, 2026 13:26
@mrksngl mrksngl self-requested a review March 2, 2026 13:41
Copy link
Copy Markdown
Member

@mrksngl mrksngl left a comment

Choose a reason for hiding this comment

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

lgtm

@mrksngl mrksngl merged commit d8c79a6 into main Mar 2, 2026
2 checks passed
@mrksngl mrksngl deleted the 32-pos-validity branch March 2, 2026 13:51
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.

Check validity of position

2 participants