curious icon indicating copy to clipboard operation
curious copied to clipboard

message_update events disappear in private channels that are not newly created

Open brakhane opened this issue 7 years ago • 3 comments

This time, no PR, as I'm not yet sure what the correct way to handle it is.

handle_message_update in State crashes when a private message is updated, because make_message tries to check message.channel.type. However, message.channel can return None if the channel is a private channel that we haven't seen yet (because it was created before a restart of the Bot, for example)

I think message.channel should, if it can't find a channel in the cache, call the Discord channel/{id} endpoint to get the necessary information

This is a pretty serious bug, BTW, because once it occurs, the bot basically stops handling any events and has to be restarted

brakhane avatar Jun 18 '18 19:06 brakhane

message.channel is a property, so that wouldn't work (you'd have to channel = await message.channel).

I think the best way to handle this is to just go with the standard and exit from state parsing entirely, as is the standard case when dealing with cache inconsistently.

Fuyukai avatar Jun 18 '18 19:06 Fuyukai

Reported as discordapp/discord-api-docs#615. According to discordapp/discord-api-docs#184 they try to work around that by issuing a CHANNEL_CREATE before sending a MESSAGE_CREATE, which works fine, but they forgot to also send when sending a MESSAGE_UPDATE.

Given my previous experience with Discord bugs, I wouldn't hold my breath until they fix it (if they ever do)

brakhane avatar Jun 19 '18 11:06 brakhane

At least they fixed the documentation to state the private_channels will always be empty.

There are no plans to fire channel_create messages for anything other than message_create.

brakhane avatar Jun 20 '18 13:06 brakhane