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

Context actions fire twice #555

Open
MercurialPony opened this issue Jan 29, 2024 · 4 comments
Open

Context actions fire twice #555

MercurialPony opened this issue Jan 29, 2024 · 4 comments
Labels
bug Something isn't working. Use severity level labels (level: <level>) to show the severity. severity: minor Not blocking features and not disruptive, can be considered "Quality Of Life" change.

Comments

@MercurialPony
Copy link
Contributor

image

@MercurialPony MercurialPony added bug Something isn't working. Use severity level labels (level: <level>) to show the severity. severity: minor Not blocking features and not disruptive, can be considered "Quality Of Life" change. labels Jan 29, 2024
@Ixrec
Copy link
Contributor

Ixrec commented Jan 29, 2024

[2024-01-29 17:44:13 INF] UserCommandHandler received 1172683791488258158 .permanp
[2024-01-29 17:44:13 INF] UserCommandHandler received 1172683791488258158 .permanp
[2024-01-29 17:44:13 ERR] Izzy Moonbot has encountered an error. Logging information...
[2024-01-29 17:44:13 ERR] Message: Cannot respond twice to the same interaction
[2024-01-29 17:44:13 ERR] Source: Discord.Net.WebSocket
[2024-01-29 17:44:13 ERR] HResult: -2146233079
[2024-01-29 17:44:13 ERR] Stack trace:    at Discord.WebSocket.SocketCommandBase.RespondAsync(String text, Embed[] embeds, Boolean isTTS, Boolean ephemeral, AllowedMentions allowedMentions, MessageComponent components, Embed embed, RequestOptions options)
   at Izzy_Moonbot.Worker.UserCommandHandler(SocketUserCommand command) in /src/Izzy-Moonbot/Worker.cs:line 502
   at Discord.EventExtensions.InvokeAsync[T](AsyncEvent`1 eventHandler, T arg)
   at Discord.WebSocket.DiscordSocketClient.TimeoutWrap(String name, Func`1 action)
[2024-01-29 17:44:13 INF] A UserCommandExecuted handler has thrown an unhandled exception.

@Ixrec
Copy link
Contributor

Ixrec commented Jan 29, 2024

Simply restarting Izzy got rid of this duplication. I believe this means

_client.UserCommandExecuted += UserCommandHandler;

got executed twice during her last... "session of uptime"(?). That happens in ReadyEvent(), and...

_client.Ready += ReadyEvent;

so I can only assume Discord sent her 2 ready events for some reason???

No idea if we can or should do anything about this. That's all I'm gonna do for now.

@MercurialPony
Copy link
Contributor Author

Huh, weird. That means everything else inside ReadyEvent was also registered and executed twice?
I guess we'll have to investigate closer if it happens again

@Ixrec
Copy link
Contributor

Ixrec commented Feb 17, 2024

Happened again today. A restart fixed it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. Use severity level labels (level: <level>) to show the severity. severity: minor Not blocking features and not disruptive, can be considered "Quality Of Life" change.
Projects
None yet
Development

No branches or pull requests

2 participants