perf: coordinate unknown id lookups
This is a huge improvement over what it was before. Now all unknown id lookups are debounced and happen through a central coordinator. This ensures there is no duplication between timelines. Fixes: https://github.com/damus-io/notedeck/issues/279 Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::{actionbar::BarResult, timeline::TimelineSource, ui, Damus};
|
||||
use nostrdb::{NoteKey, Transaction};
|
||||
use std::collections::HashSet;
|
||||
use tracing::warn;
|
||||
use tracing::{error, warn};
|
||||
|
||||
pub struct ThreadView<'a> {
|
||||
app: &'a mut Damus,
|
||||
@@ -72,11 +71,8 @@ impl<'a> ThreadView<'a> {
|
||||
};
|
||||
|
||||
// poll for new notes and insert them into our existing notes
|
||||
{
|
||||
let mut ids = HashSet::new();
|
||||
let _ = TimelineSource::Thread(root_id)
|
||||
.poll_notes_into_view(self.app, &mut ids);
|
||||
// TODO: do something with unknown ids
|
||||
if let Err(e) = TimelineSource::Thread(root_id).poll_notes_into_view(self.app) {
|
||||
error!("Thread::poll_notes_into_view: {e}");
|
||||
}
|
||||
|
||||
let (len, list) = {
|
||||
|
||||
Reference in New Issue
Block a user