Skip to content
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

Check only bridged channels for PermManageWebhooks #1001

Merged
merged 2 commits into from
Feb 8, 2020

Conversation

qaisjp
Copy link
Collaborator

@qaisjp qaisjp commented Feb 7, 2020

Background

There is an existing "bug" (maybe a Discord bug!) where checking a channel permission won't take into account inherited permissions. When that happens, you get spam like this:

spam
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "mod-botplayground"                                                             [918/1925]
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "support"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "announcements"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "media"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "music"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "modlog"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ru-основной"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "moderators"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ru-правила"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "rules"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "es-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "p-support"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Spanish / Español"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Russian / русский"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Private"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "MTA:SA"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Information"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Arabic / العربية"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ar-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "development"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Polish / Polskie"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "pl-ogólny"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "KURDISH / KURMANCI"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "kur-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "advertisements"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Hungarian / Magyar"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "hu-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "TURKISH / TÜRK"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "tr-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "INDONESIA / MALAY"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "id-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "French / Français"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "fr-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "showroom"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "feed"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "botplayground"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ru-оффтоп"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "PORTUGUESE / PORTUGUÊS"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "pt-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "es-scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "pt-scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ar-scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "scripting-edu"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "pl-scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "github"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Persian / فارسی"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "fa-عمومی"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "fa-اسکریپت-نویسی"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ru-объявления"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Archived"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "p-support"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "qaisjp-2470"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "internal"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "webdev"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "pinkies"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "irc"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "dre-6327"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "internal-ac"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "internal-dev"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "test"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "reports"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "mapping"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "graphic-design"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "modelling"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "German / Deutsch"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "de-allgemein"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "thenico-5772"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "-gᴀʙʀɪᴇʟ-火-4848"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ata-tezak-9796"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "tehciu-5888"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "8ballin"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "hemoon-zf-4479"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "axa-7286"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "emad-bishtawy-8984"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ru-разговоры"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ar-support"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ar-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "lyonexp-8203"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "branching-model-discussion"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "tr-sesli-kanal"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "deleted"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "all-members"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ransoms-place"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "fr-scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "kewun-8848"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "tr-sunucular"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "darkyzuwu-1337"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "osrhyper_tm-5533"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "server-meta"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "MTA Discord"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "MTA Development"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "kingspedra-1980"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "scripting-help-1"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "scripting-help-2"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "advanced-scripting"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "brzys-5937"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "liberty-5062"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "allerek-6054"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "sc-5081"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "blue-pie-8823"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "badouies-0044"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "river--0001"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "r7-0001"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "offtopic"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "zelda-9343"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "pl-support"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "soap-4872"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "cioccomilko_-1457"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "xlive-1000"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "Romanian/Română"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ro-general"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ro-suport"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ro-media"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ro-reclame"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ro-anunțuri"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "ro-voce"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "rp-discussions"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "jamor-6740"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "bla-1263"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "mrahmed-3653"
[2020-02-07T14:05:54Z]  WARN discord:      Can't manage webhooks in channel "screenshare"

The workaround is to keep restarting matterbridge until Discord start remembering about inherited permissions.

I'm not bridging all these channels, so matterbridge shouldn't be checking channels that I don't want bridging.

Solution

Now we only check channels that we bridge. Should also speed up startup time on large discord servers.

@42wim
Copy link
Owner

42wim commented Feb 8, 2020

Thanks!

@42wim 42wim merged commit 1420f68 into 42wim:master Feb 8, 2020
@qaisjp qaisjp deleted the hotfix/check-our-channels-only branch February 8, 2020 14:40
@42wim 42wim added this to the 1.17.0 milestone Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants