-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
irc: configure anti-looping system #2320
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep forgetting that people ask about that, even though we do have an issue about it. 😅 Thanks for just sitting down and writing the patch. Few general thoughts:
- How about
antiloop_
as a prefix for these options? Though I'm all ears for something that fits a bit better withflood_
.- As ideas for new names:
anti_looping
->antiloop_threshold
anti_looping_repeat
->antiloop_silent_after
anti_looping_timeframe
->antiloop_window
- As ideas for new names:
- With the other options already set, why not add a way to override the
...
message? Maybe someone would like Sopel to say "Ditto", for example.
8aeaab9
to
b4a5771
Compare
And I even added tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why didn't I notice the hard-coded lookback number (8 lines) before? No idea. Must have looked at the code on my phone, which always makes it easy to get lost. Small screen problems.
And I even added tests.
Blasphemy! Ban this man! /s
Albeit not perfect, the time window has it uses as it prevents some false positive. However, it's not really well done, because it only check if the last message is within that time window, so you could have one message 5s away, and the previous 7 a day old, and it'll still think there is a loop. However, I don't feel like fixing that in this PR, I would like to keep the configuration change and the behavior change as separated as possible.
On the other hand, Sopel remembers 10 messages per channel/user anyway. So I can remove that limit and just look at the last 10 messages directly. |
And so I changed the 8 to 10 and changed the doc accordingly. I added a warning in the doc for good measure, because setting the threshold to more than 10 will deactivate the loop prevention system and that might not be obvious to a user. |
Is there a reason not to clamp the value to max 10 with a custom parse (and/or serialize) function? Disabling the flood prevention is documented explicitly (and improved on by one of my recent PRs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more implementation thing about the number of messages considered, while I'm awaiting Exi's thoughts on clamping the antiloop_threshold
value to max 10.
90ecf45
to
7371b73
Compare
Given the status of the review, I squashed the commits while adding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I squashed the commits while adding the
min(10, 'antiloop_threshold')
. I replaced the warning by the note, and that's all I did in here.
You also rebased while doing that, though. I can't click "force-pushed" in the event history to get the diff between the previous state and the current state without wading through clutter pulled from upstream. :/
So I re-reviewed everything, and came up with more line notes than I probably would have if I'd only had to look at the new changes. Serves you right. 🤪
And I applied the changes. No squash, no rebase yet. You tell me when it's all OK for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see, this is good to go (squash). If I missed anything by reviewing on my phone, so be it. 🙃
Co-authored-by: dgw <dgw@technobabbl.es>
3431365
to
f565f61
Compare
Squashed. |
Description
Tin, fix #1618.
The feature was surprisingly easy to implement, this is a draft because I want to make sure I've the right names before writing more documentation.
Checklist
make qa
(runsmake quality
andmake test
)