discordextremelist / website

The official source code for the website side of DEL!
https://discordextremelist.xyz
GNU Affero General Public License v3.0
75 stars 29 forks source link

Lots of fixes #256

Closed TheAlienKnight closed 2 years ago

TheAlienKnight commented 2 years ago

All changes were tested except for autosync auto deletion for templates and servers. I'll need someone to verify that works, it should though.

Changes:

TLDR; The site shouldn't hang and die anymore, at least it didn't in my testing. I also am assuming any memory leak that did exist, has been fixed with these changes (from what I can see anyway, and the stats, this is correct).

IceeMC commented 2 years ago

bark

ConnorDoesDev commented 2 years ago

bork

advaith1 commented 2 years ago

also awaiting getters is weird; is there realistically much of a chance that the guilds/channels arent cached during operation? did you run into that?

can we just retrieve from cache and use optional chaining while accessing, so it doesn't totally break if they arent cached?

TheAlienKnight commented 2 years ago

also awaiting getters is weird; is there realistically much of a chance that the guilds/channels arent cached during operation? did you run into that?

I actually ran into an issue where since my test guild is small with only a few test accounts, it wasn't actually caching the members. I thought it was odd, and the only explanation I have is that perhaps discord.js doesn't attempt to cache smaller amounts of members if they aren't actively online/interacting. I changed it for that reason, I honestly agree it is weird, I wasn't expecting it to be the issue, but it ended up being one that impacted me during testing. Regardless, it doesn't hurt to have that fallback either- even if for a guild the size of DEL it doesn't happen often. There's always a better way, but I was trying to work around the existing code vs implement new methods/ways of doing things

can we just retrieve from cache and use optional chaining while accessing, so it doesn't totally break if they arent cached?

Possibly? I can mess around with it and see it, I honestly just went with what made the most immediate sense/worked to solve the issues I ran into

for autosync deletion can you make it only delete on the specific error codes for invalid invite/invalid template? we don't want to nuke everything on outages and stuff

I can yes, I didn't think about outages actually, good point/catch there

TheAlienKnight commented 2 years ago

Also copying the summary here:

carolinaisslaying commented 2 years ago

just re whether your issues have been addressed advaith

TheAlienKnight commented 2 years ago

The changes I just pushed fix the audit logs trying to use require() in ESM, it also fixes the crash that occurs when bots are offline on startup. Those are the last two things @advaith1 pointed out in the discord.