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

   ### Apache Airflow version
   
   3.2.2
   
   ### What happened and how to reproduce it?
   
   After marking a single task instance as `failed` (or `success`) from
   the Task Instance page, the state badge in the header keeps showing
   the previous state. A hard refresh is required to see the new state.
   The grid view stays stale as well. Marking a DAG Run as failed/success
   works correctly — only the task-instance Mark-as is affected.
   
   **Steps to reproduce**
   
   1. Start Airflow 3.2.2 standalone with examples enabled:
      `docker run -e AIRFLOW__CORE__LOAD_EXAMPLES=true -p 9080:8080 
apache/airflow:3.2.2 standalone`
   2. Unpause `example_dag_decorator` and trigger a run.
   3. Wait for `echo_ip_info` to finish with `success`.
   4. Open the task instance page:
      `/dags/example_dag_decorator/runs/<run_id>/tasks/echo_ip_info`
   5. Click the `✓ / ✗` menu (top right) → pick **failed** → confirm.
   
   The header badge keeps showing **success** until hard refresh.
   
   ### What you think should happen instead?
   
   The header state badge and the grid cell should reflect the new state
   immediately after the action confirms, the same way the DAG Run
   Mark-as flow already does.
   
   ### What I have verified
   
   - **Server is correct.** A direct PATCH then GET via curl returns the
     new state on the next read:
     - `PATCH 
/api/v2/dags/example_dag_decorator/dagRuns/<run>/taskInstances/echo_ip_info?map_index=-1`
 → 200, body shows `"state": "failed"`.
     - `GET  
/api/v2/dags/example_dag_decorator/dagRuns/<run>/taskInstances/echo_ip_info/-1` 
→ 200, `"state": "failed"`.
   - **The SPA refetch fires.** DevTools Network shows the singular
     mapped-TI `GET .../-1` triggered right after the PATCH (200 OK, 0.8 kB),
     plus refetches for the grid stream and dag details.
   - **The SPA receives the new state.** The Response body of that GET
     contains `"state": "failed"`, so the TanStack cache should have the
     fresh data.
   - Despite this, `<HeaderCard state={taskInstance.state}>` in
     `pages/TaskInstance/Header.tsx` keeps rendering the previous state.
     The grid summary cells remain stale too.
   
   This points to a cache-to-observer / render-equality issue downstream
   of `invalidateQueries`, not at the API or invalidation-key layer.
   
   ### Operating System
   
   macOS 15.5 (apache/airflow:3.2.2 container)
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   `docker run -e AIRFLOW__CORE__LOAD_EXAMPLES=true -p 9080:8080 
apache/airflow:3.2.2 standalone`
   
   ### Anything else?
   
   - Reproduces every time on every TI in every DAG tested
     (`example_dag_decorator`, `example_bash_operator`).
   - Only affects Task Instance Mark-as; DAG Run Mark-as updates the
     header badge correctly.
   - Closed PR #55504 fixed a related family of stale-grid bugs for the
     Clear action; this looks like a sibling case for Mark-as that was
     not covered.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's Code of Conduct
   


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