GayathriSrividya opened a new pull request, #67950:
URL: https://github.com/apache/airflow/pull/67950

   After marking a task instance as success/failed/skipped, the state badge
   on the task instance detail page does not update until a manual page reload.
   
   The root cause is in `usePatchTaskInstance`: the `GetMappedTaskInstance`
   query was invalidated using the full 4-field key
   `UseTaskInstanceServiceGetMappedTaskInstanceKeyFn({ dagId, dagRunId, 
mapIndex, taskId })`.
   While this exact key should theoretically match, TanStack Query's
   `partialDeepEqual` matching is more reliable when the search key is a
   **subset** of the cached key rather than an exact match.
   
   `usePatchDagRun` already uses the partial-key pattern for the same query:
   ```ts
   [useTaskInstanceServiceGetMappedTaskInstanceKey, { dagId, dagRunId }]
   ```
   
   This PR aligns `usePatchTaskInstance` to the same approach, using
   `[useTaskInstanceServiceGetMappedTaskInstanceKey, { dagId, dagRunId, taskId 
}]`
   as a partial key that matches any `mapIndex` for the given task. This also
   eliminates the separate predicate-based invalidation that was needed for the
   "patch all mapped TIs" case (`mapIndex === undefined`), simplifying the code.
   
   closes: #67883


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