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

Make GuildChannel::send_message work in threads #1449

Merged
merged 2 commits into from Jul 29, 2021

Conversation

kangalio
Copy link
Collaborator

When the cache feature is enabled, GuildChannel::send_message invokes utils::user_has_perms which tries to look up the thread in the channels cache. Threads are often not in cache, so it fails and throws a model::Error::ChannelNotFound. send_message lazily propagates any error, so the cache miss brings down the whole send_message invocation.

This PR fixes send_message to not abort the invocation if the sanity check throws an error.

When the cache feature is enabled, GuildChannel::send_message invokes utils::user_has_perms which tries to look up the thread in the channels cache, fails and throws a model::Error::ChannelNotFound. send_message lazily propagates any error, so the cache miss brings down the whole send_message invocation.
How did I manage to mess a trivial one line change up
@arqunis arqunis added fix A solution to an existing bug. model Related to the `model` module. labels Jul 28, 2021
@arqunis arqunis merged commit fb203ae into serenity-rs:current Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A solution to an existing bug. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants