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.

collab: Fix adding users to feature flags when migrating to new billing (#29795)

Marshall Bowersc4556e99099f
diff --git a/crates/collab/src/api/billing.rs b/crates/collab/src/api/billing.rs
index 15c213c71cb..3824e834c30 100644
--- a/crates/collab/src/api/billing.rs
+++ b/crates/collab/src/api/billing.rs
@@ -673,15 +673,16 @@ async fn migrate_to_new_billing(
None
};
- let feature_flags = app.db.list_feature_flags().await?;
+ let all_feature_flags = app.db.list_feature_flags().await?;
+ let user_feature_flags = app.db.get_user_flags(user.id).await?;
for feature_flag in ["new-billing", "assistant2"] {
- let already_in_feature_flag = feature_flags.iter().any(|flag| flag.flag == feature_flag);
+ let already_in_feature_flag = user_feature_flags.iter().any(|flag| flag == feature_flag);
if already_in_feature_flag {
continue;
}
- let feature_flag = feature_flags
+ let feature_flag = all_feature_flags
.iter()
.find(|flag| flag.flag == feature_flag)
.context("failed to find feature flag: {feature_flag:?}")?;