Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: A task is cancelled error after the bot has disconnected #2679

Open
3 tasks done
JoshuaMaitland opened this issue May 9, 2023 · 7 comments
Open
3 tasks done
Labels

Comments

@JoshuaMaitland
Copy link

JoshuaMaitland commented May 9, 2023

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

I've been updated the latest version of Discord.Net and when I connect the bot, it's working fine. But when I click on disconnect button (bear in mind that I'm doing this on WinForms in C#) and this error came up like this. (see logs)
This issue seems to be doing this on versions that is higher than 3.9

Version

Version that is higher than 3.9

Working Version

No response

Logs

20:15:12 Discord Discord.Net v3.10.0 (API v10)
20:15:13 Gateway Connecting
20:15:14 Gateway Connected
20:15:15 Gateway Ready
20:15:22 Gateway System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Discord.ConnectionManager.<>cDisplayClass29_0.<b0>d.MoveNext()
20:15:22 Gateway Disconnecting
20:15:22 Gateway Disconnected

Sample

No response

Packages

Discord.Net.Commands v3.10.0
Discord.Net.Core v3.10.0
Discord.Net.Interactions v3.10.0
Discord.Net.Rest v3.10.0
Discord.Net.Webhook v3.10.0
Discord.Net.WebSocket v3.10.0
MySql.Data v6.10.9
Newtonsoft.Json v13.0.3

@JoshuaMaitland
Copy link
Author

Still the same issue after upgrading to v3.11.0
DiscordNet311TestConsole_2023-07-05_20-38-50

@JoshuaMaitland
Copy link
Author

JoshuaMaitland commented Nov 26, 2023

Idk if this will ever get fixed (at least until v4) Just to give some backstory: https://github.com/discord-net/Discord.Net/blob/dev/src/Discord.Net.WebSocket/ConnectionManager.cs#L81-L89

Right, I think that might be the reason why though. Because when I was using v3.9 it doesn't print the TaskCanceledException error whilst with v3.10 or later, it does printed out a error.

@JoshuaMaitland
Copy link
Author

Still the same issue on v3.13.0

DiscordNetTestConsole_2024-01-06_12-34-28

@JoshuaMaitland
Copy link
Author

JoshuaMaitland commented May 15, 2024

One year since I've opened this issue, but it's still hasn't fixed. Still happened on v3.15.0 (latest, at the time of writing to this comment)

DiscordNetTestConsole_2024-05-15_20-34-13

@JoshuaMaitland
Copy link
Author

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

No branches or pull requests

3 participants