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

   ### SUMMARY
   
   Scheduled report screenshots can capture loading indicators even after the 
initial readiness check succeeds. Dashboard expansion, scrolling, repaint work, 
or a late chart rerender can move a chart back into its loading state between 
that check and the actual screenshot.
   
   This change closes that capture-time race by requiring the existing 
readiness predicate to remain continuously true for 500 ms immediately before 
every scheduled screenshot attempt:
   
   - standard chart and dashboard captures
   - every tiled-dashboard capture
   - blank-capture retries
   
   The check reuses the existing loading, rendered-content, terminal 
empty/error state, ECharts, and AG Grid signals. It is report-only and bounded 
by the existing execution deadline and readiness reserve. If readiness changes 
and does not stabilize within the remaining budget, capture and delivery stop 
instead of sending a spinner-filled report.
   
   The new lifecycle logs are:
   
   - `report_capture_readiness_stable`
   - `report_capture_readiness_changed`
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: a report could pass readiness, re-enter a chart loading state during 
capture preparation, and deliver a PDF containing loading indicators.
   
   After: readiness must remain stable at the screenshot boundary. A page that 
returns to loading is allowed to settle within the bounded wait; otherwise the 
report fails before capture or delivery.
   
   ### TESTING INSTRUCTIONS
   
   Run:
   
   ```bash
   pytest -q tests/unit_tests/utils/webdriver_test.py 
tests/unit_tests/utils/test_screenshot_utils.py
   ```
   
   The tests cover:
   
   - stable readiness before standard and tiled captures
   - revalidation on blank-capture retries
   - aborting before screenshot when readiness changes
   - report deadline propagation and bounded waits
   - non-report screenshot behavior remaining unchanged
   
   Also run the changed-file hooks:
   
   ```bash
   git add docs/admin_docs/configuration/alerts-reports.mdx \
     superset/utils/screenshot_utils.py \
     superset/utils/webdriver.py \
     tests/unit_tests/utils/test_screenshot_utils.py \
     tests/unit_tests/utils/webdriver_test.py
   pre-commit run
   ```
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] 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