codeant-ai-for-open-source[bot] commented on code in PR #43253:
URL: https://github.com/apache/superset/pull/43253#discussion_r3795580155


##########
superset/utils/machine_auth.py:
##########
@@ -63,7 +63,10 @@ def authenticate_browser_context(
 
         # Setting cookies requires doing a request first
         page = browser_context.new_page()
-        page.goto(headless_url("/login/"))
+        page.goto(
+            headless_url("/login/"),
+            wait_until=app.config["SCREENSHOT_PLAYWRIGHT_WAIT_EVENT"],
+        )

Review Comment:
   **Suggestion:** The new navigation waits for the configured event but does 
not handle `PlaywrightTimeout`. Unlike the screenshot navigation, which catches 
this timeout and continues, a timeout here aborts authentication before the 
target page is visited. This means configurations such as `networkidle`, or 
deployments whose login page keeps connections open, can fail the entire report 
even when the login request itself completed. Catch the navigation timeout 
consistently or use a bounded event appropriate for establishing the origin. 
[api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Authenticated screenshots fail for `networkidle` deployments.
   - ❌ Report snapshots abort before cookie installation.
   - ⚠️ Screenshot navigation already tolerates event timeouts.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9b63a13093d34bec83da1cfdf0c15ea6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=9b63a13093d34bec83da1cfdf0c15ea6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/utils/machine_auth.py
   **Line:** 66:69
   **Comment:**
        *Api Mismatch: The new navigation waits for the configured event but 
does not handle `PlaywrightTimeout`. Unlike the screenshot navigation, which 
catches this timeout and continues, a timeout here aborts authentication before 
the target page is visited. This means configurations such as `networkidle`, or 
deployments whose login page keeps connections open, can fail the entire report 
even when the login request itself completed. Catch the navigation timeout 
consistently or use a bounded event appropriate for establishing the origin.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43253&comment_hash=192faf4bdf16404890bb510f83ac2b9cad452eb650b4543a1100686994def8b3&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43253&comment_hash=192faf4bdf16404890bb510f83ac2b9cad452eb650b4543a1100686994def8b3&reaction=dislike'>👎</a>



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