Skip to content

Fix canceled-status typo in live websocket hooks - #404

Merged
cigamit merged 1 commit into
ctrliq:mainfrom
blaipr:fix/ws-canceled-status-spelling
Jun 14, 2026
Merged

Fix canceled-status typo in live websocket hooks#404
cigamit merged 1 commit into
ctrliq:mainfrom
blaipr:fix/ws-canceled-status-spelling

Conversation

@blaipr

@blaipr blaipr commented Jun 13, 2026

Copy link
Copy Markdown
Contributor
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
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • UI
ASCENDER VERSION
awx: 25.4.1.dev51+g2c31d76.d20260613
ADDITIONAL INFORMATION

Reproduction:

  1. Open a workflow job's Output tab (or an inventory source's detail) while it is running.
  2. Cancel it.
  3. Observe the graph/detail does not fully settle to its final canceled state; reloading the page shows the correct final state.

After the fix, the cancel case triggers the same full re-fetch as successful/failed/error, so the view settles without a manual reload.

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.
@blaipr blaipr changed the title Fix canceled-status spelling so live workflow/inventory views refresh on cancel Fix canceled-status typo in live websocket hooks Jun 13, 2026
@cigamit
cigamit requested a review from Copilot June 14, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 trigger refreshNodeObjects() 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 a status_changed message with status: '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 triggers fetchSource(); 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
cigamit merged commit 41c66af into ctrliq:main Jun 14, 2026
@cigamit cigamit self-assigned this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants