tirkarthi opened a new issue, #59757:
URL: https://github.com/apache/airflow/issues/59757

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   On initial load `latestDagRunId` will be undefined and when the request to 
fetch it is complete `previousDagRunIdRef.current` which is empty string "" 
will not be equal to `latestDagRunId` causing the cache to be cleared and then 
http requests are again made though they fetch same data as the initial load. 
When `previousDagRunIdRef.current` is "" with `latestDagRunId` then it's better 
to set `previousDagRunIdRef.current` with `latestDagRunId` and then proceed 
with the loop to check for the latest run to clear them when there is a new run.
   
   
https://github.com/apache/airflow/blob/f798302c4342e68e20d3ec6b7162123e1622c51d/airflow-core/src/airflow/ui/src/queries/useRefreshOnNewDagRuns.ts#L48
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   1. Go to a page with a dagrun like 
http://localhost:8000/dags/example_branch_labels
   2. Inspect the network tab. See duplicate requests for /ui and /api 
endpoints like `/ui/grid/runs`, `/ui/grid/structure` etc. though they are not 
necessary in the initial load
   
   ### Operating System
   
   Ubuntu 20.04
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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