Repository navigation
Fixes #39154: clear AutoPilot workflow state on no-run service navigation - #39188
Open
detail-app[bot] wants to merge 2 commits into
Open
detail-app[bot] wants to merge 2 commits into
detail-app[bot] wants to merge 2 commits into
Conversation
detail-app
Bot
force-pushed
the
detail/bug-fix/fixes-39154-clear-autopilot-workflow-state-on-no-r-4d21ca
branch
from
November 28, 2026 06:13
6f7a946 to
11f0fbd
Compare
This branch has not been deployed
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 #39154
I worked on clearing stale AutoPilot/Service-Insights workflow state when navigating client-side between services on the classic service details page, because once a service with an AutoPilot run was viewed, the page stayed mounted (the
/service/:serviceCategory/:fqnroute element has nokey) andworkflowStatesDatawas only set insideif (workflowInstanceId)— never cleared in anelseor on thecatchpath. The next (no-run) service therefore rendered the previous service's run status/progress, gated its live stream off staleRUNNING, queried agent statuses over the wrong run window, and wrongly disabled the "Run Agents"/AutoPilot trigger with "AutoPilot already running".Type of change:
High-level design:
N/A — small change. Mirrors the existing pattern in the sibling AI-mode hook
useServiceAgents.ts(PR #38929), which already clears the state when a service has no run.In
ServiceDetailsPage.tsxfetchWorkflowInstanceStates:else { setWorkflowStatesData(undefined); }so a no-run service clears stale state.workflowStatesDataon thecatchpath (a stale error toast is preferable to stale cross-service data).currentServiceFqnRefref guard so a workflow response that resolves after navigation to another service is discarded and cannot overwrite the current service's state (and the late fetch won't clobber the current service's loading flag).Tests:
Use cases covered
Unit tests
ServiceDetailsPage.test.tsx— instrumented theServiceInsightsTabmock to surfaceworkflowStatesDataand added aworkflowStatesData cross-service state leakblock (4 tests) covering the no-run leak, the error path, the late-response race, and the both-have-runs no-regression case. All 64 tests in the suite pass.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
make playwright_affectedlists the impacted specs; the full Playwright suite runs in the merge queue and requires a live server stack, which was not available locally (see Manual testing).Manual testing performed
ServiceDetailsPage.workflowLeak.browser.test.tsx(real Chromium + MSW, realServiceInsightsTab/DataAssetsHeader/BrowserRouter) that mountsservice-a(RUNNING run → trigger disabled), performs a true in-mount client-side navigation (history.pushState+popstate) toservice-b, and asserts the trigger goes enabled andservice-b's heading renders. Confirmed RED→GREEN: the test fails on the pre-fix component (trigger stays disabled with stale state) and passes with the fix.npx playwright install chromium,npx playwright install-deps chromium) to run the browser test; it passes.yarn test(64/64),yarn tsc:check(no errors in changed files — the 34 pre-existing errors are in unrelatedSSOUtils.test.ts/ChartDetailsUtils.test.tsx),yarn lint(0 errors, 43 pre-existing warnings unchanged), license header check, and tailwind audit gates all pass.localhost:8585refused connection) and the quickstart Docker images (2.0.0-SNAPSHOT) returnedmanifest unknownon pull; building the full mysql+elastic+server+ingestion stack from source exceeded this environment. This was attempted — the exact blocker isconnect ECONNREFUSED 127.0.0.1:8585atPOST /api/v1/auth/login. The in-mount cross-service scenario those would cover is already exercised by the browser test above.UI screen recording:
Not applicable — standalone bug fix with no new UI feature or behavior change beyond correcting stale state on navigation; the behavior is covered by the Vitest browser test.
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.docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.Automatic Fixes PRs can be configured here.