Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add fix for lost channel update bug

Mikayla75679291a9a7
diff --git a/crates/client/src/channel_store.rs b/crates/client/src/channel_store.rs
index e2c18a63a96..03d334a9def 100644
--- a/crates/client/src/channel_store.rs
+++ b/crates/client/src/channel_store.rs
@@ -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 {
diff --git a/crates/collab/src/db.rs b/crates/collab/src/db.rs
index 64349123af3..b457c4c1161 100644
--- a/crates/collab/src/db.rs
+++ b/crates/collab/src/db.rs
@@ -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>()