Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Discord voice meetups incorrectly deleted #72

Open
fildon opened this issue Jun 12, 2021 · 4 comments
Open

Discord voice meetups incorrectly deleted #72

fildon opened this issue Jun 12, 2021 · 4 comments

Comments

@fildon
Copy link
Contributor

fildon commented Jun 12, 2021

What you did:

  • Scheduled and started a Discord meetup.

What happened:

  • The meetup ran for a while but then unexpected closed.

Problem description:

  • It seems that the bot is automatically cleaning up Discord voice meetups even while people are still in them.

Suggested solution:

@fildon
Copy link
Contributor Author

fildon commented Jun 12, 2021

Further info:
Both I and @bouwe77 have observed this.
In particular @bouwe77 saw this reproduce three times in one evening.
Do not have exact time stamps however the timings seem to fit with happening around every 15 minutes.

@fildon fildon mentioned this issue Jun 12, 2021
3 tasks
@Aprillion
Copy link
Contributor

So, Rupert tested the bot today and the 15-minute part of the condition looks OK, so it must be that meetupChannel.members.size is 0 even if someone is in the room... getMeetupChannels() in https://github.com/fildon/kcd-discord-bot/blob/06b881370ef907cc79eb0b010d0471a104ffec91/src/meetup/utils.ts#L121 is using a cache, but that was added 4 months ago, not recently...

Could it be that some unrelated code that used to refresh the cache was removed??

@Aprillion
Copy link
Contributor

I checked the code a little and I the most suspicious line of code is https://github.com/fildon/kcd-discord-bot/commit/2db2be725d2124fed0674b34febaa2901e2907d4#r52204857 ... @fildon do you remember if you introduced that line for a good reason or only to make TS happy? (I suspect a runtime error might have been more useful than silencing errors in that place, at least for investigating this issue heh)

@fildon
Copy link
Contributor Author

fildon commented Jun 16, 2021

I don't think I introduced that line. Looks to be a commit by @kentcdodds 🤔
Even so it doesn't look suspicious to me. It is just handling the case that guild is undefined ... which should probably never happen, but if it does it chooses to return an empty collection when trying to get meetup channels. Which means either way the function is guaranteed to return a collection. That's useful for where it is being enumerated over elsewhere.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants