onionhammer opened a new pull request, #44109:
URL: https://github.com/apache/superset/pull/44109
authenticate_browser_context() opened a page on /login/ to "prime" the
cookie jar and never closed it. That page keeps issuing requests after
page.goto() resolves, and any response carrying an anonymous "Set-Cookie:
session=..." that lands after add_cookies() overwrites the injected cookie in
the shared browser context. The whole context then silently reverts to
anonymous: every request 302s to /login/, the screenshot renders the login
screen, .standalone never appears, and the report fails with a misleading
Locator.wait_for: Timeout ... waiting for locator(".standalone")
Being a race, it only loses when /login/ is slow to settle -- in practice
the first request after a long idle period, which is exactly when scheduled
reports tend to run.
The navigation is a Selenium carryover: driver.add_cookie() requires already
being on the domain, but BrowserContext.add_cookies() takes the domain
directly. It is also demonstrably redundant here, since clear_cookies() already
discards everything the login page set before the real cookies are injected.
Nothing downstream depends on it: WebDriverPlaywright.get_screenshot()
creates its own page after calling auth(), and the POSTs the screenshot page
makes (charts data, log, cache_dashboard_screenshot) are all in
WTF_CSRF_EXEMPT_LIST.
Fixes #44005
Signed-off-by: Erik O'Leary <[email protected]>
<!---
Please write the PR title following the conventions at
https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] 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]