From 62a030418e0546992ee7d5947d8e27ce03023b11 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Sun, 27 Sep 2026 14:20:09 +0700 Subject: [PATCH] update --- CHANGELOG.md | 4 +++- crates/signed_state/src/profile.rs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abd775e..1628e72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,9 @@ - Migrate the GPUI foundation to the published `gpui-pre` crates and GPUI Kit 0.6, off the zed and gpui-component git pins - Use the pixel avatar as the single fallback for a missing picture, sized and rounded to match the other avatars - Redesign the dock tab bar, using muted grey active tab, added close buttons, double-click to zoom, and removed panel toolbar -- Connect to fewer relays at startup, keeping only ditto and the git indexer as bootstrap relays +- Connect to bootstrap relays on demand instead of at startup +- Fetch profile metadata in batches of 100 authors, applying every requested profile in a single database query +- Prefetch the 500 most recent profiles at startup instead of 200 ### Fixed diff --git a/crates/signed_state/src/profile.rs b/crates/signed_state/src/profile.rs index c899b50..02f84b5 100644 --- a/crates/signed_state/src/profile.rs +++ b/crates/signed_state/src/profile.rs @@ -10,7 +10,7 @@ use gpui::{ use nostr_sdk::prelude::*; use utils::shorten_pubkey; -use crate::backend::{Backend, BackendEvent, subscribe_bootstrap_only}; +use crate::backend::{Backend, BackendEvent, sync_bootstrap_only}; /// How long to wait for more requests before firing a batched fetch. const BATCH_TIMEOUT: Duration = Duration::from_millis(500); @@ -282,11 +282,12 @@ impl ProfileStore { let authors: Vec = batch.drain().collect(); for chunk in authors.chunks(REQUEST_CHUNK) { + let opts = SyncOptions::default(); let filter = Filter::new() .kind(Kind::Metadata) .authors(chunk.iter().copied()); - if let Err(e) = subscribe_bootstrap_only(client, vec![filter]).await { + if let Err(e) = sync_bootstrap_only(client, filter, opts).await { log::warn!("profile fetch failed: {e}"); } }