Add fix for lost channel update bug

This commit is contained in:
Mikayla 2023-08-17 00:55:11 -07:00
parent 5bc481112e
commit 75679291a9
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View File

@ -441,10 +441,12 @@ impl ChannelStore {
for channel in payload.channels {
if let Some(existing_channel) = self.channels_by_id.get_mut(&channel.id) {
// FIXME: We may be missing a path for this existing channel in certain cases
let existing_channel = Arc::make_mut(existing_channel);
existing_channel.name = channel.name;
continue;
}
self.channels_by_id.insert(
channel.id,
Arc::new(Channel {

View File

@ -3650,7 +3650,11 @@ impl Database {
let ancestor_ids = self.get_channel_ancestors(id, tx).await?;
let user_ids = channel_member::Entity::find()
.distinct()
.filter(channel_member::Column::ChannelId.is_in(ancestor_ids.iter().copied()))
.filter(
channel_member::Column::ChannelId
.is_in(ancestor_ids.iter().copied())
.and(channel_member::Column::Accepted.eq(true)),
)
.select_only()
.column(channel_member::Column::UserId)
.into_values::<_, QueryUserIds>()