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

   ### SUMMARY
   
   Harden dashboard screenshot generation used by API/UI image and PDF exports 
so a request cannot report or cache `Updated` while charts are still loading, 
blank, or have returned to a loading state.
   
   - Persist scoped `Pending`/`Computing`/`Updated`/`Error` transitions and 
only serve images from `Updated` payloads.
   - Treat cache-write and enqueue failures as explicit failures instead of 
allowing stale or missing state to look successful.
   - Reuse the existing chart-status and renderer readiness markers to validate 
every mounted chart, including charts on the active non-first dashboard tab.
   - Apply the existing report-grade ready/blank-image checks to API screenshot 
workers, with DeckGL idle readiness added for map captures.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable: this changes server-side capture correctness and adds no 
visible UI.
   
   Before, a slow or blank dashboard could be cached as `Updated` and exported 
with spinners or empty content. After, the same cold capture ends in `Error` 
with no downloadable image; a ready capture reaches `Updated` and produces 
valid PNG/PDF output.
   
   ### TESTING INSTRUCTIONS
   
   Automated verification completed:
   
   - 223 focused backend unit tests passed.
   - 21 focused dashboard screenshot API integration tests passed.
   - 13 frontend Chart/DeckGL tests passed.
   - Changed-file pre-commit checks, Python lint/type checks, frontend 
lint/type checks, and the production webpack build passed.
   
   Manual end-to-end verification:
   
   1. Enable `THUMBNAILS` and `ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS`, 
configure Redis/Celery, and start Superset plus a Celery worker.
   2. POST to `/api/v1/dashboard/<id>/cache_dashboard_screenshot/` for a 
dashboard whose chart exceeds the screenshot wait timeout. Poll the endpoint 
response and verify `Pending` → `Computing` → `Error`; the returned image URL 
must remain unavailable.
   3. Warm the same chart and repeat. Verify `Pending` → `Computing` → 
`Updated`, then download both PNG and PDF successfully.
   4. Repeat with `activeTabs` selecting a non-first tab and verify the 
resulting PNG/PDF contains that tab with all of its charts rendered.
   
   This flow was exercised locally with Docker using Superset, PostgreSQL, 
Redis, Celery, and Playwright. The successful non-first-tab capture produced a 
complete 1600×1200 PNG and valid PDF; the forced timeout produced no cached 
spinner/blank artifact.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [x] Required feature flags: `THUMBNAILS`, 
`ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS`
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] 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