richardfogaca opened a new pull request, #36011:
URL: https://github.com/apache/superset/pull/36011
### SUMMARY
Fixes an intermittent bug where dashboard charts get stuck in loading state
with async queries enabled in Superset 6.x. The issue was introduced in PR
#31241 where a performance optimization in the Chart component's `React.memo`
comparison incorrectly prevented re-renders when the `isComponentVisible` prop
changed.
**Root Cause:**
The memo comparison function had a flawed escape hatch
(`!nextProps.isComponentVisible`) that would skip ALL re-renders for invisible
charts, regardless of whether other props changed. Additionally,
`isComponentVisible` itself was not included in the prop comparison list, so
visibility changes (false→true or true→false) were never detected.
**The Fix:**
Changed the memo comparison to explicitly check `isComponentVisible` like
any other prop:
- **Before:** `!nextProps.isComponentVisible || (/* other props */)`
- **After:** `prevProps.isComponentVisible ===
nextProps.isComponentVisible && (/* other props */)`
This ensures charts re-render when:
- Visibility changes (becoming visible/invisible)
- Any prop changes, even when invisible
- While still skipping re-renders when truly nothing changed
--
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]