Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/handlers/assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ async fn set_assignee(
IssueData::load(&mut db, issue, PREVIOUS_REVIEWERS_KEY).await?;

// Don't re-assign if already assigned, e.g. on comment edit
if issue.contain_assignee(&reviewer.name) {
if issue.contain_assignee(&reviewer.name) && issue.assignees.len() == 1 {
log::trace!(
"ignoring assign PR {} to {}, already assigned",
issue.global_id(),
Expand Down Expand Up @@ -709,6 +709,13 @@ pub(super) async fn handle_command(
.await
{
Ok(assignee) => assignee,
Err(FindReviewerError::ReviewerAlreadyAssigned { username })
if issue.contain_assignee(&event.user().login) =>
{
// If one of the assignee tries to assign another already assigned user,
// let it pass, as it means they wanted to be removed from the assignee list.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What if there are three assignees (R1, R2, R3), and R1 sends r? R2, should it unassign R3? 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No idea, it's a border line situation. I could see it go both ways.

ReviewerSelection::new(username, Vec::new())
}
Err(e) => {
issue.post_comment(&ctx.github, &e.to_string()).await?;
return Ok(());
Expand Down