Fix bugs in moving channels that could cause channels to be stranded or moved unexpectedly

Made channel linking not query in a loop

co-authored-by: Max <max@zed.dev>
This commit is contained in:
Mikayla 2023-09-20 15:32:06 -07:00
parent ee16b2051e
commit 4ff44dfa3b
No known key found for this signature in database
4 changed files with 152 additions and 95 deletions

View file

@ -2474,6 +2474,11 @@ async fn move_channel(
.move_channel(session.user_id, channel_id, from_parent, to)
.await?;
if channels_to_send.is_empty() {
response.send(Ack {})?;
return Ok(());
}
let members_from = db.get_channel_members(from_parent).await?;
let members_to = db.get_channel_members(to).await?;