discordgo icon indicating copy to clipboard operation
discordgo copied to clipboard

Several Data Race issues with State

Open bwmarrin opened this issue 4 years ago • 1 comments

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.

bwmarrin avatar Jan 24 '20 00:01 bwmarrin

See, https://github.com/bwmarrin/discordgo/issues/645, and https://github.com/42wim/matterbridge/issues/815.

bwmarrin avatar Jan 24 '20 00:01 bwmarrin