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 Client#createGuild() bug where shard was undefined #588

Merged
merged 13 commits into from Jan 1, 2020
Merged

Fix Client#createGuild() bug where shard was undefined #588

merged 13 commits into from Jan 1, 2020

Conversation

apacheli
Copy link
Contributor

@apacheli apacheli commented Dec 3, 2019

This fixes 2 issues that were recently discovered in the Eris channel.

  1. The first issue was that it was a race condition between Guild#shard and Client#guildCreate.
  2. The second issue comes from the first one. The guild obtained from REST was not cached.

@Skillz4Killz
Copy link
Contributor

Why not have a property dedicated to the client? this.client = client;. You'd never have bugs like this again and users don't need to go guild.shard.client. One way or the other, client exists in the class.

Note: This needs typings updated to reflect the changes in the PR.

@abalabahaha abalabahaha added the bug label Dec 4, 2019
lib/structures/Guild.js Outdated Show resolved Hide resolved
lib/structures/GuildChannel.js Outdated Show resolved Hide resolved
@apacheli
Copy link
Contributor Author

Sorry for delaying so long. I completely forgot about this. Happy late holidays lol

@abalabahaha abalabahaha merged commit 6bc8993 into abalabahaha:dev Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants