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

Deserialize the correct data from the GUILD_DELETE event #1028

Merged
merged 2 commits into from
Oct 19, 2020

Conversation

arqunis
Copy link
Member

@arqunis arqunis commented Oct 19, 2020

Fixes #1023.

As explained in my comment, we expect to receive data from Discord that is a PartialGuild, while in truth, Discord sends us GuildUnavailable on the GUILD_DELETE event.

@arqunis arqunis added fix A solution to an existing bug. model Related to the `model` module. breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users labels Oct 19, 2020
@lapin-b
Copy link
Contributor

lapin-b commented Oct 19, 2020

I have just tested the fix, works properly on my side; the event handler is called, call that is shown in the last line of this log excerpt:

INFO [serenity::gateway::shard] handle_event; event=Ok(Dispatch(20, GuildDelete(GuildDeleteEvent { guild: GuildUnavailable { id: GuildId(572913620132954122), unavailable: false }, _nonexhaustive: () })))
INFO [serenity::gateway::shard] handle_gateway_dispatch; seq=20 event=GuildDelete(GuildDeleteEvent { guild: GuildUnavailable { id: GuildId(572913620132954122), unavailable: false }, _nonexhaustive: () })
INFO [serenity::client::dispatch] handle_event; runner_tx=UnboundedSender(Some(UnboundedSenderInner { inner: UnboundedInner { state: 9223372036854775808, message_queue: Queue { head: 0x55a2e3ffc2f0, tail: UnsafeCell }, num_senders: 2, recv_task: AtomicWaker } })) shard_id=0
INFO [discord_bot_rs::event_handler] Deleting configuration for guild 572913620132954122

@arqunis arqunis merged commit b044b6d into serenity-rs:current Oct 19, 2020
@arqunis arqunis deleted the guild_delete_fix branch October 19, 2020 15:57
Headline added a commit to Headline/discord-compiler-bot that referenced this pull request Oct 19, 2020
Headline added a commit to Headline/discord-compiler-bot that referenced this pull request Oct 21, 2020
arqunis added a commit to arqunis/serenity that referenced this pull request Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users 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.

PartialGuild deserialization fails on GUILD_DELETE
3 participants