From d74744a0e9441568dd09d1337c3b1f3c4f53d08b Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Mon, 30 Mar 2026 10:20:36 -0700 Subject: [PATCH] Swap KVP store used for collab favorites (#52756) We should generally prefer using the normal key value store Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- crates/collab_ui/src/collab_panel.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index d5026e19bc1c2d3613d688bb262b007bc2141da6..6a53e590586ec2353feafe267501619e8bbfcc71 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -9,7 +9,7 @@ use channel::{Channel, ChannelEvent, ChannelStore}; use client::{ChannelId, Client, Contact, User, UserStore}; use collections::{HashMap, HashSet}; use contact_finder::ContactFinder; -use db::kvp::{GlobalKeyValueStore, KeyValueStore}; +use db::kvp::KeyValueStore; use editor::{Editor, EditorElement, EditorStyle}; use fuzzy::{StringMatch, StringMatchCandidate, match_strings}; use gpui::{ @@ -473,7 +473,7 @@ impl CollabPanel { }); } - let favorites: Vec = GlobalKeyValueStore::global() + let favorites: Vec = KeyValueStore::global(cx) .read_kvp("favorite_channels") .ok() .flatten() @@ -1947,12 +1947,6 @@ impl CollabPanel { } fn persist_favorites(&mut self, cx: &mut Context) { - // GlobalKeyValueStore uses a sqlez worker thread that the test - // scheduler can't control, causing non-determinism failures. - if cfg!(any(test, feature = "test-support")) { - return; - } - let favorite_ids: Vec = self .channel_store .read(cx) @@ -1960,10 +1954,11 @@ impl CollabPanel { .iter() .map(|id| id.0) .collect(); + let kvp_store = KeyValueStore::global(cx); self.pending_serialization = cx.background_spawn( async move { let json = serde_json::to_string(&favorite_ids)?; - GlobalKeyValueStore::global() + kvp_store .write_kvp("favorite_channels".to_string(), json) .await?; anyhow::Ok(())