dzlandis
DIAdiscord.js - Imagine an app
•Created by dzlandis on 9/24/2024 in #djs-voice
AbortError: the operation was aborted
But this is the only error occurring closest to the time of crash 🤷♂️
17 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 9/24/2024 in #djs-voice
AbortError: the operation was aborted
Correct
17 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 9/24/2024 in #djs-voice
AbortError: the operation was aborted
Despite me handling unhandledExceptions through event listeners
17 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 9/24/2024 in #djs-voice
AbortError: the operation was aborted
Also, is it possible that this could be causing a full bot crash? I've noticed a correlation between this error firing and my whole bot just dying.
17 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 9/24/2024 in #djs-voice
AbortError: the operation was aborted
Should I just remove it then? Will I run into any issues by doing that?
17 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 9/24/2024 in #djs-voice
AbortError: the operation was aborted
Yes
17 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Will hopefully report back if I notice a major memory improvement in production 👍
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
And irrespective of if it fixes it or not, thanks for taking the time to help out :)
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Well if this solves my memory leak problem, massive thanks to you 🙏
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
For whatever reason, I wasn't passing player or audio into that function before this
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Oooo, I may have just found my issue then 👀
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
i.e.
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Could referencing the "player" variable in a function but not passing "player" into the function be the problem?
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
If that isn't what you mean, lmk
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
I don't reference the "audio" let variable inside of the event listeners if that is what you mean
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Also, would storing the audio resource in a
let
variable cause a problem as it related to garbage collection? Cause I do store it like let audio
and then assign the stream to the audio variable later in the code.27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
I should also specify, that the way I use audio resources may be kind of different than the typical music player, as I'm not using it for that use case. A new unique audio resource is created when a user runs a command. And at the bottom of the command function, I'm listening to events relating to the player (playing, idle, error). I don't think this would cause any issues, but maybe it does as it relates to garbage collection as it is an event listener? Any insight into this is appreciated.
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Taking a step back, how would I even use
player.stop()
if I wanted to? player.play()
is not async which means I can't await
it in the sense that I wait for the audio to finish playing. So if I called player.stop()
after player.play()
it wouldn't play the audio in the first place... Am I just meant not to use player.stop()
in this case and fully rely on the idle state after the audio finishes playing?27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
And I think what I was hinting at here, is that it doesn't destroy the stream or resource directly, hence making it susceptible to memory leaks with garbage collection and other references as you previously mentioned.
27 replies
DIAdiscord.js - Imagine an app
•Created by dzlandis on 7/30/2024 in #djs-voice
Listening to Player Events + Removing References + player.stop() & Memory Leaks
Play a new resource on a new player would be the one. Although, I am running
joinVoiceChannel()
each time, but its my understanding that if a connection already exists, if I call that function, it just uses the existing connection, correct?27 replies