Repository navigation
Fixes #38373: invalidate about-entity cache after a task transition - #38409
Merged
harsh-vador merged 2 commits intoNov 23, 2026
Merged
harsh-vador merged 2 commits into
harsh-vador merged 2 commits into
Conversation
Address review feedback on TaskDetailPanel.cache.test.tsx: keep the real TaskActivityTimeline instead of mocking it, and assert the acknowledgment event renders after the ack transition — so the test fails if the panel stops passing the refetched incident status history to the timeline, not just if the cache wiring changes.
4 tasks done
harsh-vador
enabled auto-merge (squash)
November 23, 2026 06:18
harsh-vador
disabled auto-merge
November 23, 2026 06:18
harsh-vador
approved these changes
Nov 23, 2026
ShaileshParmar11
approved these changes
Nov 23, 2026
harsh-vador
deleted the
detail/bug-fix/fixes-38373-invalidate-about-entity-cache-after-a-b419fe
branch
November 23, 2026 07:10
harsh-vador
added a commit
that referenced
this pull request
Nov 23, 2026
…tion (backport 2.1 #38409) (#38426) * fix(inbox): invalidate about-entity cache after a task transition (cherry picked from commit 22db4b0) * test(inbox): assert refreshed incident history reaches the timeline Address review feedback on TaskDetailPanel.cache.test.tsx: keep the real TaskActivityTimeline instead of mocking it, and assert the acknowledgment event renders after the ack transition — so the test fails if the panel stops passing the refetched incident status history to the timeline, not just if the cache wiring changes. (cherry picked from commit c622089) --------- Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detail bug report: View on Detail
Describe your changes:
Fixes #38373
I worked on the inbox incident timeline going stale while the task detail panel stayed open, because acting on an incident from its own panel never refreshed the cached incident status history that drives the Activity stream.
TaskDetailPanel.runTransitionadvanced only localtaskstate after a successful Ack/Assign/Resolve. The incident status history that theTaskActivityTimelinerenders lives in the React Query cache keyed underTASK_ABOUT_ENTITY_QUERY_KEY(useTaskAboutEntity), keyed per task with a 60 s stale time. The panel's other refresh paths (handleCommentMutated,syncTransitionsAfter, the parents'onResolved/onTaskUpdatedhandlers) invalidateTASK_LIST_QUERY_KEY,TASK_STATUS_COUNTS_QUERY_KEY,INBOX_OPEN_TASK_COUNT_QUERY_KEYandMY_TASKS_QUERY_KEY, but none of them touch the about-entity cache (a grep of the whole UI tree confirmed it is only referenced insideuseTaskAboutEntity.ts). With the globalQueryClientdisabling focus refetch and a mounted query not auto-refetching when it goes stale, the panel kept rendering the pre-transition history indefinitely while the server had already appended the new incident-status record — so the timeline contradicted its own status header. Introduced in commit36729ad778(PR Improvement: rebuild the inbox triage task surface #33578).setTask(resolved)inrunTransition, invalidate the about-entity cache so the mounteduseTaskAboutEntityquery refetches the latest incident status history in the background (the hook keeps the cached tiles rendered while a refetch is in flight):TaskDetailPage.handleTaskChangedandTasksTabalready invalidate their sibling caches. The invalidation is purely additive — it does not replace the existing list/count invalidations, and the prefix-key form (just[TASK_ABOUT_ENTITY_QUERY_KEY]) matches the existing codebase convention.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
runTransitionpath) also invalidates the cache for all task types, not just incidents.resolveTask) does not invalidate the cache and does not trigger a refetch — the timeline keeps the history it has.Unit tests
TaskDetailPanel.cache.test.tsx: renders the realTaskDetailPanelwith the realuseTaskAboutEntityhook inside aQueryClientProvider(mirroring the app config — 60 s stale time, no focus refetch), mocking only the REST boundary. Asserts that after anacktransitioninvalidateQueriesis called with{ queryKey: ['inbox-task-about-entity'] }andgetListTestCaseIncidentByStateIdis called a second time (mount + post-transition refetch); and that a rejectedresolveTaskcalls neither. The file is separate fromTaskDetailPanel.test.tsxbecause that suite mocksuseTaskAboutEntityfile-wide, which would hide the cache behaviour.TaskDetailPanel.test.tsx: added ajest.mock('@tanstack/react-query', ...)stub foruseQueryClient(the suite mocksuseTaskAboutEntityand renders without aQueryClientProvider), preserving the realQueryClient/QueryClientProviderused byrenderWithQueryClient. All 116 existing tests still pass.TaskDetailPanel.tsx: 98.83% lines (target: 90%); the new invalidation branch is covered.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
InboxPageJest tree (44 suites / 789 tests) is green;yarn tsc:checkmatches the baseline (no new errors); ESLint + Prettier + organize-imports + license-header are clean and idempotent on the three changed files.invalidateQueriesline makes the new regression test fail withExpected: {"queryKey": ["inbox-task-about-entity"]}, Number of calls: 0; restoring it makes both tests pass.docker/development/docker-compose.yml, ranOpenMetadataSetup migrate, then bootedopenmetadata-service-2.0.0-SNAPSHOT.jaragainstconf/openmetadata.yaml) and seeded an incident task end-to-end. Confirmed via REST that each transition appends the expected incident-status record toGET /v1/dataQuality/testCases/testCaseIncidentStatus/stateId/{stateId}:[New](1 record)ack(POST /tasks/{id}/resolve{transitionId:"ack"}):[Ack, New](2 records), taskstatus: "InProgress"assign(with{payload:{assignees:[{id,type:"user",name:"admin"}]}}):[Assigned(admin), Ack, New](3 records)resolve(with{comment, payload:{testCaseFailureReason:"FalsePositive"}}):[Resolved(resolvedBy=admin), Assigned(admin), Ack, New](4 records), taskstatus: "Completed"transitionId) leaves the history unchanged at[New], matching the cache-not-invalidated behaviour asserted by the Jest test for the failed path. These are exactly the recordsgetIncidentStatusEventsmaps tomessage.task-event-incident-acknowledged/-assigned/-resolved(already unit-tested intaskTimeline.utils.test.ts).app_statestore that Playwright'sstorageStatecannot capture (it only snapshots cookies + localStorage), and blocking/app-worker.jsto fall back to localStorage wipes the in-memory token on anypage.gotoreload. The personal-space/inboxroute is also only reachable via the AI-mode sidebar shell, not from the production-bundle default/route (SPApushStateto/inboxbounced to/404). The fix's UI-level behaviour is established by the RED-GREEN Jest regression (above) running against the realuseTaskAboutEntityhook in aQueryClientProvider, which asserts both theinvalidateQueriescall and the secondgetListTestCaseIncidentByStateIdfetch fire immediately after a successful transition.UI screen recording:
Not applicable — the change is a one-line cache invalidation wiring fix; the UI surface is unchanged and the bug is covered by a Jest regression test against the real React Query hook. (Per the PR template, standalone fixes with no UI surface change may use this N/A.)
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below. — not run; please flag anyREVIEW.mdfindings in review.Automatic Fixes PRs can be configured here.


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues remain.Summary
Refreshes cached about-entity data after a successful task transition so the open panel can show the latest incident history.
Reviews (2) · Last reviewed commit: "test(inbox): assert refreshed incident h..." · Reviewed by Greptile