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

Numbers without a decimal point in JSON files crash GUI #588

Closed
jonahsnider opened this issue Feb 2, 2024 · 2 comments · Fixed by #592
Closed

Numbers without a decimal point in JSON files crash GUI #588

jonahsnider opened this issue Feb 2, 2024 · 2 comments · Fixed by #592
Labels
bug Something isn't working

Comments

@jonahsnider
Copy link

Describe the bug

If you change any of the numbers in a JSON (ex. .pathplanner/settings.json) to no longer have a fractional value, PathPlanner will crash when it tries parsing the file.

To Reproduce

  1. Open .pathplanner/settings.json
  2. Change defaultMaxAccel to 3
  3. Open PathPlanner
  4. Observe that the app crashes

Expected behavior

The app should not crash. The JSON spec says that numbers may have a fraction part, but are not required to.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions: (please complete the following information):

  • OS: N/A
  • GUI Version: 2024.1.2
  • PPLib Version: N/A
  • PPLib Language: N/A

Additional context

See dart-lang/sdk#46883 for the others experiencing the same issue with Dart JSON parsing

@jonahsnider jonahsnider added the bug Something isn't working label Feb 2, 2024
@mjansen4857
Copy link
Owner

Can fix this, but do not change the default constraints manually, as the changes will not be propagated to the paths using them until the next time settings are changed.

@jonahsnider
Copy link
Author

Thanks! For our team, we noticed this issue just from having Spotless configured with JSON formatting enabled. It'd remove the trailing .0s and cause PathPlanner to crash. We ended up just adding the config JSON as an exception in our project.

@mjansen4857 mjansen4857 linked a pull request Feb 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants