fix(dashboard): native filters do not preserve bigint#24413
Conversation
| extraFilters.push({ | ||
| col: column, | ||
| op: '>=', | ||
| val: Number(search), |
There was a problem hiding this comment.
@justinpark do you know what additional value using Number(...) provides? This is how the backend handles the filtering logic which casts strings to numbers and thus maybe it's ok for the backend to handle both cases, i.e., we could remove lines 54–60.
We could include a comment of the form,
// for numeric columns the backend casts the search string to the appropriate type—preventing JavaScript overflow. Additionally we use the fairly crude(and insufficient) >= operator as a proxy for detecting whether the search string is contained within the column given there is no trivial way of dynamically casting the the column type.
Codecov Report
@@ Coverage Diff @@
## master #24413 +/- ##
==========================================
- Coverage 68.96% 68.91% -0.05%
==========================================
Files 1904 1904
Lines 74092 73922 -170
Branches 8120 8120
==========================================
- Hits 51100 50946 -154
+ Misses 20880 20865 -15
+ Partials 2112 2111 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
#24418 is an alternative formulation which also addresses searching/filtering of numerical values. |
SUMMARY
There is an overflow issue when searching for bigint records in the native filters, i.e., the value passed to the backend is a rounded form of the specified UI value.
This hotfix handles the bigint value in a string form to preserve the value in JSON
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
Before:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION