[ui] Sensor history: Fix tick ID variable #23802
Merged
+7
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
There is a bug on the sensor tick table where clicking to view a run requested for a tick can show information about an unrelated tick.
This is because sensor tick IDs can be larger than JavaScript's
Number.MAX_SAFE_INTEGER
, but they're being cast toNumber
for the GraphQL variable. JS may cast the value to a number that doesn't match the intended value, resulting in the wrong tick ID being sent in the query.We shouldn't be trying to represent them as
number
in JS. The GraphQL input type expects it to be a BigInt, and we can just pass a string for that.How I Tested These Changes
View sensor tick history with ticks that have tick IDs being cast to incorrect values. Verify that the values are now correct, and that when I click to view runs requested for the tick, the query variable and rendered output are correct.