amaannawab923 commented on PR #42088: URL: https://github.com/apache/superset/pull/42088#issuecomment-5108222347
thanks @rusackas . i traced the whole requery path with some logging (writeOwnState → the dashboard/explore requery guards → triggerQuery → exploreJSON) on a dashboard with an ag grid table in client mode, server pagination off. the clientView write does reach triggerQuery, the getRelevantDataMask strip doesn't stop it. dashboard trace on a single column filter: writeOwnState patchKeys=['clientView'] serverPagination=false (AgGridTableChart) getAffectedOwnDataCharts affected=['99'] (getOwnDataCharts) triggerQuery DISPATCH key=99 value=true (Dashboard.tsx:134, via applyFilters) runQuery INVOKED chartId=99 exploreJSON API CALL key=99 ownStateKeys=['clientView','chartState'] → /chart/data so getAffectedOwnDataCharts flags the chart even with clientView stripped, and applyFilters → refreshCharts → triggerQuery(true) fires a /chart/data on every filter/sort. why the strip doesn't cover it: getRelevantDataMask (and the matching strip in ExploreViewContainer around index.tsx:781) omit only the clientView key, but the ownState also carries a chartState entry, visible on every requery as ownStateKeys=['clientView','chartState']. the clientView write recomputes that ownState, chartState survives the clientView-only strip and differs, so the diff-based guard sees a change and requeries. the strip reads like it assumed clientView was the only transient field in ownState, and the chartState fold breaks that. explore hits the same thing through a different door: ExploreViewContainer has a useEffect([props.ownState]) whose strip is also clientView-only, so it calls onQuery → triggerQuery(true) on the clientView write. so in practice it isn't export-only: every filtered-row update in client mode routes through the query-triggering ownState and refetches, and on the dashboard the refetch remounts the grid and drops the live filter. fix-wise two options: extend both strips to also ignore chartState, or keep clientView/chartState out of the ownState that feeds the requery guards in the first place. happy to put up whichever you prefer, and can share the full instrumented trace if it's useful. Attatched the video demonstrating the requery due to writeOwnState, with Server pagination disabled we can still see serveral refetches and api calls https://github.com/user-attachments/assets/3e3fdb6d-dfcb-432c-aa40-c5c2cd22a6f8 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
