abhijeets25012-tech opened a new pull request, #64324:
URL: https://github.com/apache/airflow/pull/64324

   ## What
   
   Disable auto-refresh (polling) in the UI when the server returns 401 or 403 
responses.
   
   ## Why
   
   Currently, the UI continues to poll APIs even when the server responds with 
403 (forbidden) or 401 (unauthorized). In such cases, it is unlikely that 
permissions will change immediately, leading to unnecessary repeated requests 
and potential server load.
   
   ## How
   
   - Added a guard in the `refetchInterval` logic to stop polling when response 
status is 401 or 403.
   - Added a safety check to handle cases where `dag_runs` data is undefined.
   - Preserved existing polling behavior for valid states (i.e., when runs are 
still pending).
   
   ## Affected Area
   
   - Frontend (React UI)
   - File: `src/pages/DagRuns.tsx`
   
   ## Behavior Change
   
   Before:
   - UI keeps polling even after receiving 401/403 responses.
   
   After:
   - UI stops polling immediately on 401/403 responses.
   
   ## Testing
   
   - Verified that polling stops when API returns 401/403.
   - Confirmed existing polling behavior remains unchanged for active DAG runs.
   
   ## Notes
   
   This aligns with expected behavior to avoid unnecessary API calls when 
access is denied.
   


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

Reply via email to