🐛 fully reset workflow state when batch review completes (#1363) (#1386)#1397
Open
konveyor-ci-bot[bot] wants to merge 1 commit intorelease-0.4from
Open
🐛 fully reset workflow state when batch review completes (#1363) (#1386)#1397konveyor-ci-bot[bot] wants to merge 1 commit intorelease-0.4from
konveyor-ci-bot[bot] wants to merge 1 commit intorelease-0.4from
Conversation
## Summary Fixes the extension getting stuck in "resolution is in progress" after accepting a solution and reverting the file, preventing analysis from running. ## Problem When the user completes a batch review (accepts/rejects all files), `checkBatchReviewComplete` only cleared `pendingBatchReview` but did **not** reset the workflow state flags: - `isFetchingSolution` stayed `true` - `solutionState` stayed on `"started"` or `"received"` - `isWaitingForUserInteraction` could be stuck `true` - `isProcessingQueuedMessages` could be stuck `true` This caused `SolutionWorkflowOrchestrator.validatePreconditions()` to reject new solution requests (`"Solution already being fetched"`), and the UI to report resolution was in progress indefinitely. ### Why this happens: 1. `SolutionWorkflowOrchestrator.workflowCleanup()` runs when `workflow.run()` completes AND the queue drains 2. But the batch review UI **outlives** the workflow — individual file accept/reject/continue actions go through `webviewMessageHandler` 3. After the orchestrator cleans up, the webview message handler removes files from `pendingBatchReview` one at a time 4. When the last file is removed, `checkBatchReviewComplete` fires — but it only cleared the array, not the workflow flags 5. If the orchestrator's cleanup missed any flags (race condition, error path, etc.), they stay stuck forever ## Fix `checkBatchReviewComplete` now performs a **full workflow state reset** when the batch is done: 1. **Reset all solution workflow flags** — `isFetchingSolution=false`, `solutionState="none"`, `isWaitingForUserInteraction=false`, `isProcessingQueuedMessages=false` 2. **Reset analysis flags** — `isAnalyzing=false`, `isAnalysisScheduled=false` 3. **Dispose stale workflow resources** — queue manager, pending interactions map, resolver function 4. **Clear caches** — `modifiedFiles`, `kaiFsCache` This acts as a safety net: even if the orchestrator's cleanup missed something, the batch review completion guarantees a clean slate. ## Testing 1. Run analysis and receive a solution suggestion 2. Open the solution in review mode 3. Accept the solution (or Accept All) 4. Revert the file (`git checkout`, undo, etc.) 5. Attempt to run analysis again 6. ✅ Analysis should run without issues — no "resolution in progress" error Also verify normal flow still works: 1. Run analysis → get solution → accept/reject all files → batch review completes 2. ✅ Can immediately start a new solution workflow Fixes: #1363 Jira: [MTA-6862](https://redhat.atlassian.net/browse/MTA-6862) --------- Signed-off-by: ibolton336 <ibolton@redhat.com> Signed-off-by: Ian Bolton <ibolton@redhat.com> Signed-off-by: Cherry Picker <noreply@github.com>
djzager
approved these changes
May 1, 2026
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.
Summary
Fixes the extension getting stuck in "resolution is in progress" after
accepting a solution and reverting the file, preventing analysis from
running.
Problem
When the user completes a batch review (accepts/rejects all files),
checkBatchReviewCompleteonly clearedpendingBatchReviewbut didnot reset the workflow state flags:
isFetchingSolutionstayedtruesolutionStatestayed on"started"or"received"isWaitingForUserInteractioncould be stucktrueisProcessingQueuedMessagescould be stucktrueThis caused
SolutionWorkflowOrchestrator.validatePreconditions()toreject new solution requests (
"Solution already being fetched"), andthe UI to report resolution was in progress indefinitely.
Why this happens:
SolutionWorkflowOrchestrator.workflowCleanup()runs whenworkflow.run()completes AND the queue drainsaccept/reject/continue actions go through
webviewMessageHandlerfiles from
pendingBatchReviewone at a timecheckBatchReviewCompletefires — butit only cleared the array, not the workflow flags
path, etc.), they stay stuck forever
Fix
checkBatchReviewCompletenow performs a full workflow state resetwhen the batch is done:
isFetchingSolution=false,solutionState="none",isWaitingForUserInteraction=false,isProcessingQueuedMessages=falseisAnalyzing=false,isAnalysisScheduled=falseinteractions map, resolver function
modifiedFiles,kaiFsCacheThis acts as a safety net: even if the orchestrator's cleanup missed
something, the batch review completion guarantees a clean slate.
Testing
git checkout, undo, etc.)error
Also verify normal flow still works:
completes
Fixes: #1363
Jira: MTA-6862
Signed-off-by: ibolton336 ibolton@redhat.com
Signed-off-by: Ian Bolton ibolton@redhat.com
Signed-off-by: Cherry Picker noreply@github.com