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

fix(model, cache): unavailable is optional and false and none equal #2377

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Erk-
Copy link
Member

@Erk- Erk- commented Oct 5, 2024

Unavailable would assume false if the field was false if it was not sent.

The ability to tell the difference can be used to tell the difference between a guild becoming available and joining a new guild.

Resolves #2372

Unavailable would assume false if the field was false if it was not
sent.

The ability to tell the difference can be used to tell the difference
between a guild becoming available and joining a new guild.

Resolves #2372
@github-actions github-actions bot added c-cache Affects the cache crate c-model Affects the model crate t-fix Fixes a bug in the library labels Oct 5, 2024
Copy link
Member

@vilgotf vilgotf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think twilight_model::gateway::payload::incoming::GuildDelete is affected too1:

Sent when a guild becomes or was already unavailable due to an outage, or when the user leaves or is removed from a guild. The inner payload is an unavailable guild object. If the unavailable field is not set, the user was removed from the guild.

Footnotes

  1. https://discord.com/developers/docs/topics/gateway-events#guild-delete

As the helpful comment we have says
@Erk- Erk- force-pushed the erk/fix/resolve-guild-avail-ambiguity branch from 550ff45 to 96b027b Compare October 5, 2024 17:46
@Erk- Erk- requested a review from vilgotf October 5, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-cache Affects the cache crate c-model Affects the model crate t-fix Fixes a bug in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ambiguity between Guild Joining and Unavailable Guilds becoming Available
3 participants