jenwitteng opened a new pull request, #42033:
URL: https://github.com/apache/superset/pull/42033

   ### SUMMARY
   
   When `GLOBAL_ASYNC_QUERIES` is enabled, uncached chart-data requests return 
HTTP 202 with async job metadata instead of inline results. `StatefulChart` 
(used by chart components that fetch their own data) previously treated this 
metadata as chart data, causing charts to render "No data" until a refresh 
warmed the cache.
   
   This PR enables `StatefulChart` to detect and resolve HTTP 202 responses via 
an injected `handleAsyncChartData` hook, wired from `ChartRenderer`. The 
implementation:
   - Detects 202 responses via the standardized async-query shape (channel_id + 
job_id + result_url)
   - Polls the async event channel and resolves cached results
   - Supports abort signals to cancel async waits mid-flight  
   - Fails loudly if 202 arrives with no handler
   - Cleans up event listeners properly to avoid stale-callback races
   
   The handler flows through the existing hooks chain, keeping 
`superset-ui-core` decoupled from app-level async-event middleware.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A - Backend behavior fix, no UI changes
   
   ### TESTING INSTRUCTIONS
   
   1. Enable `GLOBAL_ASYNC_QUERIES` in superset_config.py
   2. Configure a results backend (Redis/S3/etc.)
   3. Create a chart that uses `StatefulChart` for data fetching
   4. Clear cache and load the chart
   5. Verify chart renders with data (not "No data")
   6. Check browser console for no errors
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue: 
   - [ ] Required feature flags: `GLOBAL_ASYNC_QUERIES`
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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]

Reply via email to