You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect it might be because it's trying to initialize DiscordService each time a plugin's ServiceCollection is added to the MutableServiceProvider I made (which allows adding / removing services that are from plugins). It might be worth while to patch DiscordService so things like this would just work:tm:.
Steps to Reproduce
Clone these 2 pull requests (the ones posted above)
dotnet pack -c Release and then add their ./nuget/ folder's to a nuget.config file to a Discord Bot that uses Remora.Plugins
that add this to your IHostBuilder config to your bot (Extensions.Hosting):
.UseServiceProviderFactory(new MutableServiceProviderFactory()) (Add using LuzFaltex.Extensions.DependencyInjection; to top of file first).
try to run the bot in debug (or in a way that allows you to see the logs).
Expected Behavior
For everything to just work:tm:.
Current Behavior
DiscordService errors, which then kills the bot.
Library / Runtime Information
Version of Remora.Discord: 2022.47.0
Version of .NET Runtime: 6.0.8 (servicing)
Logs
2022-09-01 09:01:55.571 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Starting dispatch service...
2022-09-01 09:01:55.583 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Retrieving gateway endpoint...
2022-09-01 09:01:55.595 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Starting dispatch service...
2022-09-01 09:01:55.603 -04:00 [ERR] [Remora.Discord.Hosting.Services.DiscordService] Exception during gateway connection: The dispatch service is already running.
System.InvalidOperationException: The dispatch service is already running.
at Remora.Discord.Gateway.Services.ResponderDispatchService.Start()
at Remora.Discord.Gateway.DiscordGatewayClient.RunAsync(CancellationToken stopRequested)
2022-09-01 09:01:55.712 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Starting a new session (999 session starts remaining of 1000; limits reset in "23:30:50.8660000")
2022-09-01 09:01:55.923 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Connecting to the gateway...
2022-09-01 09:01:55.923 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Starting dispatch service...
2022-09-01 09:01:55.924 -04:00 [ERR] [Remora.Discord.Hosting.Services.DiscordService] Exception during gateway connection: The dispatch service is already running.
System.InvalidOperationException: The dispatch service is already running.
at Remora.Discord.Gateway.Services.ResponderDispatchService.Start()
at Remora.Discord.Gateway.DiscordGatewayClient.RunAsync(CancellationToken stopRequested)
2022-09-01 09:01:55.924 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Starting dispatch service...
2022-09-01 09:01:55.924 -04:00 [ERR] [Remora.Discord.Hosting.Services.DiscordService] Exception during gateway connection: The dispatch service is already running.
System.InvalidOperationException: The dispatch service is already running.
at Remora.Discord.Gateway.Services.ResponderDispatchService.Start()
at Remora.Discord.Gateway.DiscordGatewayClient.RunAsync(CancellationToken stopRequested)
2022-09-01 09:01:55.924 -04:00 [INF] [Remora.Discord.Gateway.DiscordGatewayClient] Starting dispatch service...
2022-09-01 09:01:55.925 -04:00 [ERR] [Remora.Discord.Hosting.Services.DiscordService] Exception during gateway connection: The dispatch service is already running.
System.InvalidOperationException: The dispatch service is already running.
at Remora.Discord.Gateway.Services.ResponderDispatchService.Start()
at Remora.Discord.Gateway.DiscordGatewayClient.RunAsync(CancellationToken stopRequested)
The text was updated successfully, but these errors were encountered:
Ah I see now, it was fixed with 8b8b64f, however no nuget stable release was pushed yet so I will need to use the unstable packages temporarily until then.
Description
Currently it looks like DiscordService does not check to see if the Dispatch service is already running before it tries to start it (again).
This happened when I got Foxtrek64/Remora.Plugins#1 and LuzFaltex/LuzFaltex.Extensions.DependencyInjection#1 to work (experimental Rewrite to Remora.Plugins to allow for unloadable plugins that also automatically reloads them when it sees that a plugin assembly was recompiled (updated)).
I suspect it might be because it's trying to initialize DiscordService each time a plugin's ServiceCollection is added to the MutableServiceProvider I made (which allows adding / removing services that are from plugins). It might be worth while to patch DiscordService so things like this would just work:tm:.
Steps to Reproduce
dotnet pack -c Release
and then add their./nuget/
folder's to a nuget.config file to a Discord Bot that uses Remora.Plugins.UseServiceProviderFactory(new MutableServiceProviderFactory())
(Addusing LuzFaltex.Extensions.DependencyInjection;
to top of file first).Expected Behavior
For everything to just work:tm:.
Current Behavior
DiscordService errors, which then kills the bot.
Library / Runtime Information
Version of Remora.Discord: 2022.47.0
Version of .NET Runtime: 6.0.8 (servicing)
Logs
The text was updated successfully, but these errors were encountered: