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

[Client] Fix issue with clearing multitag buffer #1299

Conversation

DevonRD
Copy link
Contributor

@DevonRD DevonRD commented Mar 22, 2024

The state multitagResultBuffer dictionary uses integer keys, and stringifying the reference key yielded null results. This caused an infinite while loop on "Reset Samples" (null is always != 0) and caused the entire multitag pose standard deviation section to display the nullish-coalesced default values. Fixed the reference and added in a nullish coalescing condition on the suspect while loop to avoid the frontend lockup if this is somehow encountered again in the future

Fixes #1203

@DevonRD DevonRD requested a review from a team as a code owner March 22, 2024 06:13
@srimanachanta
Copy link
Member

Is there a more efficient way we could go about clearing the sample buffer instead of using a loop to clear it? Can't we set the length of the array to 0?

@DevonRD
Copy link
Contributor Author

DevonRD commented Mar 22, 2024

Is there a more efficient way we could go about clearing the sample buffer instead of using a loop to clear it? Can't we set the length of the array to 0?

Updated

@DevonRD
Copy link
Contributor Author

DevonRD commented Mar 22, 2024

Also found and fixed a bug where if the buffer was undefined when going into the tab (e.g. viewing "Targets" before having multiple targets) the multitarget buffer was not reactive. It needs to be pre-initialized to an empty array if attempting to reference it in this scenario

@DevonRD DevonRD changed the title Fix improper multitag buffer reference Fix multitag buffer reference Mar 22, 2024
@srimanachanta srimanachanta changed the title Fix multitag buffer reference [Client] Fix issue with clearing multitag buffer Mar 23, 2024
@srimanachanta srimanachanta merged commit 0106880 into PhotonVision:master Mar 23, 2024
27 checks passed
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.

"Reset Samples" button for standard deviations freezes the page
2 participants