-
Notifications
You must be signed in to change notification settings - Fork 615
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
Skip empty messages. #1261
Skip empty messages. #1261
Conversation
9c6eb77
to
6476915
Compare
Sorry, we can't block empty messages there, we have status messages which can be empty. |
@42wim my bridges are performing much better with this change. No disconnects since. What about if both username and msgtext are empty instead? The problem is the added CPU load of sending empty messages to 8+ bridged networks only to be refused in the end by each one because it's empty. |
6476915
to
e20e90d
Compare
yes, i understand the issue that's why I'm asking which bridges do still send empty messages. Also curious about the extra cpu load how many messages per second are you sending? |
It varies depending on time of day, sometimes it can be a lot less than 1 per second, sometimes 5-10+ across all the different gateways. Blank messages aren't actually sent by any of the bridges, but they seem to make it all the way through the chain which is why I'd rather cut them out earlier... If i recall correctly, I think with debug mode on I've seen messages from the keybase client refusing to send blank messages. My bridge sits in some quite busy channels, so I've got tengo scripts set up to block a lot of matching unnecessary noise. If you really think this method will cause issues then perhaps we need to add an editable boolean to the procoutmessage tengo logic that flags messages to be discarded @42wim ? |
e20e90d
to
671ed3c
Compare
Code Climate has analyzed commit 671ed3c and detected 0 issues on this pull request. View more on Code Climate. |
I want to fix the cause instead of the symptoms, so I need to know who is sending those empty messages. Could you find that in your debug log? |
I'll switch it back on for a bit and report back. I still don't see what the benefit is of not skipping unwanted messages before they're passed on to each bridge though... It is such a massive performance increase on my end that I'll end up continuing to build myself and patch this in... 🤷 |
Just switched debug on and realised that I obviously don't see these errors anymore with my custom build... I'll play with it at a quieter time of day |
maybe tengo is generating those empty messages, if it's not coming from the bridges? |
@42wim yes, I'm using tengo to blank messages, as that's the only method of actually skipping messages using tengo rules :) Here's the log without this patch, that's an awful lot of work for an empty message, using this patch the only output I get in the log is the Receiving PRIVMSG line
|
Ok, now I understand you're creating those messages yourself with tengo. Could you paste your tengo script? |
@TheHolyRoger see PR #1272 |
@42wim brilliant thank you!! tengo script:
|
Currently empty messages are still attempted to send via every enabled bridge. This adds a lot of unnecessary overhead when using tengo scripts to skip certain messages by blanking msgText and msgUsername.
This little change cuts out empty messages earlier.
It intentionally doesn't check msgUsername, because I've seen a few tengo scripts blanking msgUsername in order to send chat commands over the bridge (to achieve getting the first character of the message be an ! or $ for example).
#942