Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decoding fixed length arrays of struct in python sbp2json [AP-946] #1378

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

woodfell
Copy link
Contributor

@woodfell woodfell commented Nov 20, 2023

Description

@swift-nav/devinfra

Alter the python decoding generated code so that fixed length arrays which contain structs (as opposed to primitive types) are properly decoded with the correct parser for the filled type.

Variable length arrays are already decoded properly in all cases, it's only fixed length arrays which are broken. Only the python binding are affected by this bug.

API compatibility

Sort of.

The output of the python version of sbp2json changes.

Currently messages which contain a fixed length array of structs are decoded as byte arrays in the python version of sbp2json. This is misleading.

The rust version of sbp2json is able to decode these constructs properly. Therefore the output of the python and rust version of sbp2json can differ given identical inputs.

In the current definition there are only 3 message types which suffer from this behaviour - MsgTrackingIq, MsgTrackingIqDepA, MsgTrackingIqDepB - all very rare and not really seen in the wild.

Therefore compatibility risk is practically zero.

API compatibility plan

None required

JIRA Reference

https://swift-nav.atlassian.net/browse/AP-946

@woodfell woodfell marked this pull request as ready for review November 20, 2023 12:56
@woodfell woodfell requested a review from a team as a code owner November 20, 2023 12:56
@woodfell woodfell changed the title Fix decoding fixed length arrays of struct in python sbp2json Fix decoding fixed length arrays of struct in python sbp2json [AP-946] Nov 20, 2023
@woodfell woodfell force-pushed the woodfell/broken_python_sbp2json branch from 34d5cc4 to 327e1e0 Compare November 21, 2023 00:45
Copy link

[libsbp-c] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@woodfell woodfell merged commit e6060b9 into master Nov 21, 2023
10 checks passed
@woodfell woodfell deleted the woodfell/broken_python_sbp2json branch November 21, 2023 01:05
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.

4 participants