Skip to content

Bug: block_assignment incorrectly blocks all users after any unassignment, not just the unassigned userΒ #410

@antedotee

Description

@antedotee

Describe the bug

Description

When block_assignment: true is enabled, the action incorrectly blocks all users from self-assigning an issue after any user has been unassigned, instead of only blocking the specific user who was unassigned.

Expected Behavior

Only User A should be blocked from reassigning themselves. User B (and any other user who was never unassigned) should be able to assign themselves normally.

Actual Behavior

All users are blocked from assigning the issue after any unassignment occurs, even if they were never assigned/unassigned themselves.

Root Cause

The bug is in src/handlers/comment-handler.ts lines 307-315. The code checks if any unassigned comment exists in the issue, rather than checking if the current user was specifically unassigned.

When the unassigned_comment template doesn't include {{handle}} (or when the rendered template doesn't uniquely identify the user), the check comment.body?.includes(mustache.render(unassignedComment, { handle: userHandle })) matches any unassigned comment, regardless of which user it was for.

Steps to reproduce

  1. Configure the action with block_assignment: true
  2. User A comments /assign on an issue β†’ User A gets assigned
  3. User A comments /unassign β†’ User A gets unassigned
  4. User B (who was never assigned) comments /assign on the same issue β†’ User B is incorrectly blocked

Browsers

No response

Additional context (Is this in dev or production?)

I faced the issue in the beta branch.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions