Skip to content

Fix: Cancel current item button disabled after switching from multiuser to singleuser mode#100

Merged
lstein merged 2 commits intolstein/bugfix/enable-cancel-button-in-singleuser-modefrom
copilot/fix-cancel-button-disabled
Feb 28, 2026
Merged

Fix: Cancel current item button disabled after switching from multiuser to singleuser mode#100
lstein merged 2 commits intolstein/bugfix/enable-cancel-button-in-singleuser-modefrom
copilot/fix-cancel-button-disabled

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 28, 2026

Summary

When switching from multiuser to singleuser mode, the "Cancel Current Item" button in the left panel becomes permanently disabled. ProtectedRoute calls logout() on switch to singleuser, clearing auth.user to null. Since no user is ever fetched in singleuser mode, currentUser stays null, causing canCancelCurrentItem to always return false.

Fix in useCancelCurrentQueueItem.ts:

  • Query multiuser_enabled from the setup status endpoint
  • Short-circuit the user-ownership check when in singleuser mode — return !!currentQueueItem directly, bypassing currentUser entirely
  • Multiuser ownership/admin logic is unchanged
const canCancelCurrentItem = useMemo(() => {
  // In single-user mode, no ownership check needed
  if (!multiuserEnabled) {
    return !!currentQueueItem;
  }
  if (!currentUser || !currentQueueItem) return false;
  if (currentUser.is_admin) return true;
  return currentQueueItem.user_id === currentUser.user_id;
}, [currentUser, currentQueueItem, multiuserEnabled]);

The middle-panel cancel button was unaffected because it operates on an explicit item prop rather than the global currentQueueItem + currentUser state.

Related Issues / Discussions

QA Instructions

  1. Enable multiuser mode (multiuser: true in invokeai.yaml), log in, and confirm the cancel button works during generation.
  2. Switch to singleuser mode (multiuser: false), reload the browser.
  3. Start a generation — the "Cancel Current Item" button in the left panel should activate and successfully cancel the job.
  4. Confirm the button is disabled when the queue is idle.

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)
Original prompt

This section details on the original issue you should resolve

<issue_title>[bug]: Cancel current item button disabled after changing from multiuser to singleuser</issue_title>
<issue_description>### Is there an existing issue for this problem?

  • I have searched the existing issues

Install method

Invoke's Launcher

Operating system

Linux

GPU vendor

Nvidia (CUDA)

GPU model

No response

GPU VRAM

No response

Version number

main, commit 146b936

Browser

main branch

System Information

No response

What happened

I installed the current version of main which introduces the new multiuser feature (commit 146b936). I activated multiuser mode by setting multiuser: true in invokeai.yaml and confirmed that the mode was working as expected.

I then switched back to singleuser mode by setting multiuser: false and reloaded the browser window. Since then, the "Cancel Current Item" button located at the top of the left panel has stayed disabled during image rendering. Reloading the window and resetting to defaults does not seem to fix the problem.

Interestingly, the "Cancel Current Item" button located in the middle panel is not affected by this bug.

What you expected to happen

I expect the cancel current item button to activate when a session item is in progress and for it to be disabled when the system is idle. I suspect that there is an unwanted interaction with the code that prevents a user from cancelling another user's session when in multiuser mode.

How to reproduce the problem

No response

Additional context

No response

Discord username

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cancel current item button disabled in singleuser mode Fix: Cancel current item button disabled after switching from multiuser to singleuser mode Feb 28, 2026
@lstein lstein marked this pull request as ready for review February 28, 2026 14:49
@lstein lstein self-requested a review as a code owner February 28, 2026 14:49
Copy link
Copy Markdown
Owner

@lstein lstein left a comment

Choose a reason for hiding this comment

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

Works as advertised.

@lstein lstein merged commit 26896b7 into lstein/bugfix/enable-cancel-button-in-singleuser-mode Feb 28, 2026
19 of 25 checks passed
@lstein lstein deleted the copilot/fix-cancel-button-disabled branch February 28, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants