fix(ag-grid): persist value aggregation changes without a sort - #41388
fix(ag-grid): persist value aggregation changes without a sort#41388amaannawab923 wants to merge 1 commit into
Conversation
…thout a sort (#97551) Changing a column's Value Aggregation only persisted if another piece of grid state (such as a sort) changed at the same time, because the grid-state change detector hashed only column order, sorts and filters. This matches the reported workaround (trigger a sort, then Update chart). Include per-column aggFunc in the capture signature so the change is detected and saved on its own. Same root cause as #107166. Add unit tests for the Explore 'change aggregation then Update chart' scenario.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41388 +/- ##
==========================================
- Coverage 64.42% 64.41% -0.01%
==========================================
Files 2654 2655 +1
Lines 145386 145390 +4
Branches 33557 33558 +1
==========================================
- Hits 93658 93657 -1
- Misses 50031 50036 +5
Partials 1697 1697
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EnxDev's Review Agent — #41388 · HEAD da53bf7lgtm — Correct, minimal fix: the column-state change signature now folds in per-column Classified as a fix. The extraction of the inline 🟡 Should-fix
🔵 Nits
🙌 Praise
Note: PR is still a draft ( |
SUMMARY
Changing a metric's Value Aggregation on an interactive table and clicking Update chart didn't save — it quietly reverted to the previous option. The one workaround people found was to also trigger a sort on the column first and then update, which was a big hint about what was going on.
The grid's column-state change detection only keyed off column order, sorts and filters, so a standalone aggregation change wasn't captured at all. Triggering a sort changed the detected state and dragged the aggregation along with it — hence the workaround. Including the per-column aggregation in the change signature makes the aggregation change persist on its own.
This shares its root cause with the related "Value Aggregation None doesn't persist" fix — same signature gap, different symptom.
TESTING INSTRUCTIONS
SUM(sales)).Unit tests added covering that an aggregation change alters the capture signature without any sort/order/filter change.
ADDITIONAL INFORMATION