EnxDev opened a new pull request, #39944:
URL: https://github.com/apache/superset/pull/39944
### SUMMARY
Scheduled Reports on dashboards (especially with native filters that take a
moment to hydrate) intermittently fail screenshot capture with:
```
Failed taking a screenshot Locator.wait_for: Timeout 60000ms exceeded.
Call log:
- waiting for locator(".standalone") to be visible
114 × locator resolved to hidden <body class="standalone">…</body>
```
The body element does have `class="standalone"` (server-rendered), but
Playwright reports it **hidden**. Root cause: the SSR'd `spa.html` body only
contains an absolutely-positioned spinner, so before React mounts, the body's
content height is `0` and Playwright's `wait_for(state="visible")` keeps
reporting "hidden" until React fills the layout. On slow first paints (cold
webpack compile, complex native filter hydration, etc.), React mount can exceed
the 60s wait and the report errors out.
This is a regression-class issue independent of the multi-tab `urlParams`
fix in #39884: the URL is correct, the body has the right class, but the
locator's visibility check fails on the empty body box.
Reproduced locally by blocking JS/CSS subresources after `domcontentloaded`:
- **Before:** `body bbox = 1584 × 0`, Playwright says HIDDEN.
- **After:** `body bbox = 1600 × 2000`, Playwright says VISIBLE.
The fix pins `html, body.standalone` to `min-height: 100vh; margin: 0;` in
`spa.html` whenever `standalone_mode` is true. This is the screenshot/embed
code path, so non-standalone navigations are untouched.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — change is in the SSR shell during a sub-second window before React
mounts; not visually observable in the final report screenshot.
### TESTING INSTRUCTIONS
1. Set `FEATURE_FLAGS["ALERT_REPORTS"] = True`, `ALERT_REPORT_TABS = True`,
`ALERT_REPORTS_FILTER = True`, `PLAYWRIGHT_REPORTS_AND_THUMBNAILS = True`,
`ALERT_REPORTS_NOTIFICATION_DRY_RUN = True`.
2. On any dashboard with tabs + native filters (e.g. **Sales Dashboard**),
create a per-minute Report (PNG): pick a single tab, add a `filter_select`
value (e.g. `Country = USA`).
3. Watch `report_execution_log` — pre-fix, runs intermittently fail with
`Locator.wait_for: ... .standalone`. Post-fix, the wait resolves immediately
and screenshots succeed.
Automated coverage:
-
`tests/unit_tests/extension_tests.py::test_spa_template_standalone_body_has_min_height`
renders the Jinja template and asserts the `min-height: 100vh` rule is present
in standalone responses and absent otherwise. Removing the rule from `spa.html`
makes this test fail.
- All existing `tests/unit_tests/commands/report/execute_test.py` tests
continue to pass — this PR does **not** touch the `_get_tabs_urls` /
`urlParams` merge logic shipped in #39884.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `ALERT_REPORTS`,
`PLAYWRIGHT_REPORTS_AND_THUMBNAILS` (existing)
- [ ] 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]