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

Warn about fixed length Photon arrays instead of throwing #274

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

jwbonner
Copy link
Member

Fixed length arrays are supported by non-Photon structs, which still need to be compiled by PhotonStructDecoder. This isn't an actual issue unless a Photon struct tries to use a struct with an unsupported array. Returning false just indicates that the schema cannot be compiled or used in parent Photon schemas.

Fixes #273

Fixed length arrays are supported by non-Photon structs, which still need to be compiled by PhotonStructDecoder. This isn't an actual issue unless a Photon struct tries to use a struct with an unsupported array. Returning false just indicates that the schema cannot be compiled or used in parent schemas.
@jwbonner
Copy link
Member Author

@mcm001 Does this seem like a reasonable solution?

@mcm001
Copy link
Contributor

mcm001 commented Nov 16, 2024

Maybe skull issue on my part but why does PhotonStructDecoder need to parse non-photon types?

@mcm001
Copy link
Contributor

mcm001 commented Nov 16, 2024

I'm cool with whatever unbreaks us for now, and I'll dig into the new issue when I get home to establish an MVP to reproduce

@jwbonner
Copy link
Member Author

My understanding is that Photon structs can have normal structs nested within them? If Photon publishes its own versions of the geometry types, this whole issue could be sidestepped by separating them.

There's no rush on this, we just did a beta release a few days ago so it will probably be a little while.

@mcm001
Copy link
Contributor

mcm001 commented Nov 16, 2024

Ah yep you're right. We do support VLAs of wpilib struct types within our messages, provided that those nested wpilib types do not themselves contain any fixed length arrays.

Honestly? Maybe I should just make photon structs support fixed length arrays. It's kinda silly to force everyone to use VLAs lol

@mcm001
Copy link
Contributor

mcm001 commented Nov 17, 2024

In the meantime we should send this one though lol

@jwbonner jwbonner merged commit 9c642ac into main Nov 19, 2024
30 checks passed
@jwbonner jwbonner deleted the warn-on-photonschema-fixed-arrays branch November 19, 2024 03:36
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.

Struct decoding breaks in sim with error "Fixed length arrays are unimplemented"
2 participants