discordgo
discordgo copied to clipboard
Several Data Race issues with State
Currently MemberAdd, GuildAdd, ChannelAdd, PresenceUpdate methods update objects inflight. This is a problem because end users could also have a pointer to one of these objects and be reading or writing to them at the same time. These methods should create new updated objects and then replace them.
Also, allowing access to embedded Ready object allows for Data Races as well. We can't just remove it though as I'm sure lots of people are using it.
See, https://github.com/bwmarrin/discordgo/issues/645, and https://github.com/42wim/matterbridge/issues/815.