deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
658 stars 84 forks source link

disable ratelimiter for bots? #3436

Closed r10s closed 2 years ago

r10s commented 2 years ago

current master contains a "ratelimiter" that limits the rate of MDNs and probably soonish the rate of webxdc-updates and sync-messages so that one badly programmed webxdc or another client requesting tons of MDNs do not lead to problems.

if ratelimit happens, messages are delayed, updates that happen in between are aggregated to even save some messages.

current limit is max. 3 messages per minute (algorithm is "token bucket policy", see #3402)

"manually" sent messages are not limited, however, they will be count and may delay the automatically generated messages.

question that came up on discussion with @hpk42: is limiting/delaying auto-generated messages also fine for bots? or should we use a larger limit there or disable ratelimit completely? (we could just check the bot config option and say bots should take care of that on their own)

cc @adbenitez @link2xt @flub @hpk42

link2xt commented 2 years ago

Makes sense, current implementation is useful only for a single user who does not read hundreds of chats in parallel like a bot can do. For bots it's a good idea to limit the rate of MDNs too, but we need separate limits per contact then, so one user requesting MDNs does not prevent other users from receiving MDNs.

r10s commented 2 years ago

the per-contact MDN-ratelimit sounds like quite some work and code to maintain, also not sure if it is really needed and an urgent issue currently.

so maybe just disable ratelimit for bots for now, getting some experiences for normal accounts first. we can iterate over as needed anytime.