hotfix(DynamicVoiceChat): delay deleting channelLeft on history fetch#1397
Closed
christolis wants to merge 1 commit intoTogether-Java:developfrom
Closed
hotfix(DynamicVoiceChat): delay deleting channelLeft on history fetch#1397christolis wants to merge 1 commit intoTogether-Java:developfrom
channelLeft on history fetch#1397christolis wants to merge 1 commit intoTogether-Java:developfrom
Conversation
By letting the JDA asynchornously retrieve the voice channel history and
figure out if we are going to delete the channel in question without
making sure one finishes before the other gets executed, we receive this:
RestAction queue returned failure: [ErrorResponseException] 10003:
Unknown Channel net.dv8tion.jda.api.exceptions.ContextException
at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
at net.dv8tion.jda.api.requests.Request.<init>(Request.java:78)
at net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:203)
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:577)
at org.togetherjava.tjbot.features.voicechat.DynamicVoiceChat.handleVoiceChannelLeave(DynamicVoiceChat.java:84)
at org.togetherjava.tjbot.features.voicechat.DynamicVoiceChat.onVoiceUpdate(DynamicVoiceChat.java:68)
at org.togetherjava.tjbot.features.system.BotCore.lambda$onGuildVoiceUpdate$1(BotCore.java:306)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
Delay deleting `channelLeft` channel by 500ms and use
`RestAction#onSuccess` to make sure that the channel history request is
done _first_ and completely, before we move on to deleting the channel.
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
tj-wazei
requested changes
Jan 26, 2026
application/src/main/java/org/togetherjava/tjbot/features/voicechat/DynamicVoiceChat.java
Show resolved
Hide resolved
Contributor
|
Issue has been resolved #1398 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By letting the JDA asynchronously retrieve the voice channel history and figure out if we are going to delete the channel in question without making sure one finishes before the other gets executed, we receive this:
Delay deleting
channelLeftchannel by 500ms and useRestAction#onSuccessto make sure that the channel history request is done first and completely, before we move on to deleting the channel.