Skip to content

Duplicate http requests on loading dag details page #59757

@tirkarthi

Description

@tirkarthi

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.

if (latestDagRunId !== undefined && previousDagRunIdRef.current !== latestDagRunId) {

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    AIP-38Modern Web Applicationarea:UIRelated to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions