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

[wpilib] Make GameSpecificMessage optional #7445

Conversation

spacey-sooty
Copy link
Contributor

Resolves #7444

@spacey-sooty spacey-sooty requested a review from a team as a code owner November 29, 2024 03:27
HAL_MatchInfo info;
HAL_GetMatchInfo(&info);
return std::string(reinterpret_cast<char*>(info.gameSpecificMessage),
info.gameSpecificMessageSize);
if (info.gameSpecificMessage) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it actually null or is it zero-length?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is 0 length based off the compile error

Copy link
Member

Choose a reason for hiding this comment

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

No, this isn't the sort of thing you should be guessing at, it can be empirically (or otherwise) determined.

Especially When making a PR for a public project that is used by others, we probably shouldn't be guessing at things that are testable and/or knowable. There are certainly things that one has to guess at because it isn't possible to know it, or it involves a judgement call of some kind. This isn't one of those sorts of things (after all, how can you be sure that you fixed the bug that the PR is trying to fix without testing it?), and recognizing when that's the case and doing the extra work when needed will make you a better developer in the long run.

I don't typically make these sorts of critiques, but I do recognize that you've made a lot of high quality contributions to WPILib and seem to be very capable, and so I hope this thought will positively impact you and anyone else who reads this conversation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do plan to test this and as such probably should've marked this as a draft. I more meant guess it's the correct approach to take before testing it (ie test this approach first) but that's a very valid criticism and I definitely should've made that more clear, my apologies!

@ThadHouse
Copy link
Member

This isn’t the correct fix. 0 length it not the same as not sent. This will require Hal changes.

@spacey-sooty spacey-sooty marked this pull request as draft November 29, 2024 12:32
@KangarooKoala
Copy link
Contributor

Since #7444 was closed (FIRST stated empty string will never be a valid value), can this be closed?

@sciencewhiz
Copy link
Contributor

Closing as OBE

@spacey-sooty spacey-sooty deleted the optional-game-specific-info branch December 1, 2024 07:22
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.

Game Specific Message should return an optional
5 participants