Fix canceled-status typo in live websocket hooks - #404
Merged
Conversation
The workflow output and inventory-source detail websocket hooks gated their full node/detail re-fetch on the status 'cancelled' (British spelling), but AWX emits 'canceled'. As a result, when a workflow (or inventory source sync) is canceled while its live view is open, the final re-fetch never fires and the view can show stale node/detail state until the page is reloaded. Use the correct 'canceled' spelling in both hooks.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a UI live-update bug where websocket-driven “job finished → full re-fetch” logic did not run for canceled jobs due to a terminal-status typo (cancelled vs canceled). This ensures Workflow Output graphs and Inventory Source details fully resync to backend state immediately after a cancel event.
Changes:
- Update terminal-status gating in the Workflow Output websocket hook to recognize
canceled. - Update terminal-status gating in the Inventory Source details websocket hook to recognize
canceled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
awx/ui/src/screens/Job/WorkflowOutput/useWsWorkflowOutput.js |
Fix terminal status check to trigger node refresh on cancel (canceled). |
awx/ui/src/screens/Inventory/shared/useWsInventorySourcesDetails.js |
Fix terminal status check to trigger source detail refresh on cancel (canceled). |
Comments suppressed due to low confidence (2)
awx/ui/src/screens/Job/WorkflowOutput/useWsWorkflowOutput.js:60
- The updated terminal-status list now includes
'canceled', which changes behavior (it will triggerrefreshNodeObjects()on cancel). There don’t appear to be any tests exercising this hook’s websocket cancel path; consider adding a regression test (likely via existing WorkflowOutput* tests) that sends astatus_changedmessage withstatus: 'canceled'and asserts the full refresh occurs.
if (
lastMessage?.unified_job_id === workflowJobId &&
['successful', 'failed', 'error', 'canceled'].includes(
lastMessage.status
)
) {
refreshNodeObjects();
awx/ui/src/screens/Inventory/shared/useWsInventorySourcesDetails.js:33
- This change makes
'canceled'(one-L) a terminal status that triggersfetchSource(); the existing test only asserts the refresh on'successful'. Consider extending the test coverage to include'canceled'so the cancel regression is explicitly guarded.
if (
['successful', 'failed', 'error', 'canceled'].includes(
lastMessage.status
)
) {
fetchSource();
}
setSource(updateSource(source, lastMessage));
cigamit
approved these changes
Jun 14, 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
Two live-view websocket hooks gate their "job finished, re-fetch everything" path on the terminal status
'cancelled'(British spelling), but Ascender/AWX emits'canceled'(one L). Because the spelling never matches, the full re-fetch is skipped specifically on cancel:screens/Job/WorkflowOutput/useWsWorkflowOutput.js— when a workflow is canceled while its Output graph is open,refreshNodeObjects()never runs. Per-node updates that arrived during the run still show, but nodes that were marked do-not-run by the cancellation (or whose final summary fields changed) keep showing stale state until the page is reloaded.screens/Inventory/shared/useWsInventorySourcesDetails.js— same pattern for the inventory-source detail view on cancel.'successful' / 'failed' / 'error'are unaffected because those spellings match. The fix is a one-word change in each hook to the correct'canceled'spelling. The rest of the UI already uses'canceled'(one L) consistently (22 occurrences vs. these 2 typos).This is backend-data-safe — it only affects whether the live view re-syncs to the already-correct backend state on cancel.
ISSUE TYPE
COMPONENT NAME
ASCENDER VERSION
ADDITIONAL INFORMATION
Reproduction:
After the fix, the cancel case triggers the same full re-fetch as successful/failed/error, so the view settles without a manual reload.