notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 2af44641db6e9c2c63ddf7b76938b8d3168f882f
parent c1cf7ea32472b1e89dbdd4aa9f873f70cf2169f3
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 27 May 2024 09:25:18 -0700

cap size of remote filter limits

I noticed the responses are a bit slow without this. Local query limits
are not capped.

Fixes: https://github.com/damus-io/notedeck/issues/98
Changelog-Changed: Restrict remote filter sizes to 250 (for now)
Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/app.rs | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/app.rs b/src/app.rs @@ -97,6 +97,12 @@ fn send_initial_filters(damus: &mut Damus, relay_url: &str) { let mut filter = timeline.filter.clone(); for f in &mut filter { since_optimize_filter(f, timeline.notes(ViewFilter::NotesAndReplies)); + + // limit the size of remote filters + let lim = f.limit.unwrap_or(100); + if lim > 150 { + f.limit = Some(150); + } } relay.subscribe(format!("initial{}", c), filter); c += 1;