[ BUG ] ResumeAsync not working properly due to JSON serialization
Glaceon7 opened this issue · 4 comments
Describe the bug/issue.
Hi, a friend of mine had used the latest package(5.2.2 as we speak) of Victoria. This lead to him not being able to use the ResumeAsync() method properly. The music did not continue playing after pausing. We reverted back to version 5.1.11 and the ResumeAsync() method worked.
Please provide as many details as possible. Such as line number, file name, if the bug is reproducible, etc.
The bot was in the channel, it was playing music. We paused it. We then tried to continue/resume it by using ResumeAsync(), which didn't work for him in the latest update.
sorry if this is a poor bugreport, this is the first time I've done so.
Stacktrace / Screenshots
https://cdn.discordapp.com/attachments/776208596857126942/882629743806119966/unknown.png
This was logged after ResumeAsync(), though it didn't make the bot crash / error anything but in the log.
When debugging yourself, you can attach screenshots of Autos/Locals tabs in Visual Studio.
What version of Lavalink are you using. The payload for Pause and Resume are the same.
Hello, I've also experienced this issue in 5.2.1 and it carried over to the 5.2.2 version for me.
I did some digging around the code, and I believe I've found the issue. It's due to the serialization options of the payload, that ignores default values. In order to pause or resume the track, the json to be sent to the server, needs to have a "pause" property set to "true" to pause or set to "false" to resume. But since the serialization options ignore default values (which for a "bool" property is "false"), the pause property of the payload doesn't get serialized when you want to resume.
You are absolutely right! I will try other JSON serialization flags to workaround the null values instead of defaults