Skip to content

Task modal: show a failed form fetch's reason instead of hanging - #2091

Merged
fog-workflows[bot] merged 1 commit into
dev-branchfrom
fix/task-modal-error-hang
Nov 11, 2026
Merged

fog-workflows[bot] merged 1 commit into
dev-branchfrom
fix/task-modal-error-hang

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Problem

Forum topic 18314 (1.6.0.14). On a host with no image, Tasks > Capture opens "Create new tasking", and the modal stays on "Loading, please wait..." for good.

?node=host&sub=deploy answers 400 {"error":"Assigned image is invalid"}. The error handler called taskModal.modal('hide'). Bootstrap 5 drops a hide() that lands inside the show transition, and the 400 comes back faster than the fade. So the modal stayed open, and only a toast said why.

The same handler is on the task list's Recent re-deploy. The group Tasks tab did not try to hide the modal at all, and hung the same way.

Change

  • $.taskFormFailed in fog.common.js ends the loading state, sets the title, writes the escaped reason into the modal as a red alert, and shows the toast. $.registerMassEdit already fixed the same race this way.
  • The host Tasks tab, the group Tasks tab and the task list re-deploy call it from their error handlers. None of them hides the modal now.

The reporter also asked for Deploy and Capture to be greyed out on a host with no image. This PR does not do that. The modal now states the reason, which removes the confusion.

Tests

  • tests/task-form-error-stays-in-modal.test.php pins each page's error handler and the helper. It goes red when any of the three handlers is put back to the old code.
  • tests/run-all.sh: 484 passed, 0 failed.
  • Lab (1.6, 10.255.20.1), with the changed JS served over the server's copies by page.route(). Nothing was deployed:
    • Host with no image, Capture and Deploy: before, "Loading, please wait..." with the spinner; after, the red alert "Assigned image is invalid", no spinner, title "Capture".
    • Group Tasks tab: group deploy does not refuse a member with no image, so the error path ran against a simulated 400. The reason showed in the modal. The success path still renders the form.
    • The task list re-deploy was not exercised in the browser.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JAdRb4vjzwmwYP54GuG1dH

Forum topic 18314. Capture on a host with no image left "Create new
tasking" on "Loading, please wait..." for good. ?sub=deploy answers 400
"Assigned image is invalid", and the error handler called
modal('hide') inside Bootstrap 5's show transition, which drops it.
The group Tasks tab did not try to hide at all, and hung the same way.

$.taskFormFailed ends the loading state and writes the escaped reason
into the modal, as $.registerMassEdit already does. The host Tasks
tab, the group Tasks tab and the task list re-deploy all use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAdRb4vjzwmwYP54GuG1dH
@fog-workflows
fog-workflows Bot enabled auto-merge November 11, 2026 15:01
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Nov 11, 2026
Merged via the queue into dev-branch with commit bdc0a7b Nov 11, 2026
36 of 45 checks passed
@fog-workflows
fog-workflows Bot deleted the fix/task-modal-error-hang branch November 11, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant