-
Notifications
You must be signed in to change notification settings - Fork 5
Description
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
- Configure the action with
block_assignment: true - User A comments
/assignon an issue β User A gets assigned - User A comments
/unassignβ User A gets unassigned - User B (who was never assigned) comments
/assignon 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