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

Long-running async tasks can have their responses posted in the wrong place #49

Closed
jbrowneuk opened this issue Apr 14, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jbrowneuk
Copy link
Owner

If a long-running fetch task occurs (i.e. getting an image for a command) and more messages arrive before the API response is received, the cached "last message" is updated and the channel the response is sent to will change.

i.e.:
Channel 1 userA: +get-slow-api-response
*bot begins data request
Channel 2: userB: anything
*API returns results, bot processes
Channel 2: bot: api response

This means the bot can potentially post a response to a request in a different server.

@jbrowneuk jbrowneuk added the bug Something isn't working label Apr 14, 2021
@jbrowneuk jbrowneuk self-assigned this Apr 14, 2021
jbrowneuk added a commit that referenced this issue Apr 26, 2023
This change set removes the caching of the last received message from the bot's discord client. The old behaviour meant if a message comes in during processing, it would potentially respond to the wrong channel.

The code has been updated to explicitly pass through the source message so the response is sent to the same channel.

Addresses #49
@jbrowneuk
Copy link
Owner Author

The latest changes need to be tested on the nightly version of the bot but should hopefully have been fixed with #98

@jbrowneuk
Copy link
Owner Author

Appears to be fixed with the mentioned PR. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant