Skip to content

UI: Fix task instance state badge staying stale after Mark-as action#67950

Open
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/ui-ti-badge-stale-67883
Open

UI: Fix task instance state badge staying stale after Mark-as action#67950
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/ui-ti-badge-stale-67883

Conversation

@GayathriSrividya
Copy link
Copy Markdown
Contributor

@GayathriSrividya GayathriSrividya commented Jun 3, 2026

closes: #67883

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:

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

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jun 3, 2026
@GayathriSrividya GayathriSrividya force-pushed the fix/ui-ti-badge-stale-67883 branch from d20ce45 to 745d9e4 Compare June 3, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Task instance state badge stays stale after Mark-as action

1 participant