discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
985 stars 236 forks source link

Fix Voice State Update caching #1014

Closed SQKo closed 1 year ago

SQKo commented 1 year ago

Reported by Discord Member Tady#5553

It seems that voice state member cache would have race condition when the user switch channels quickly, The caching code did not await for the data changes to invalidate it, making it possible for 1 or more voice channels containing the same member.

This PR fixes it, however the drawback is slower code since the library will need to check all voice channels in the guild (instead of just the old one).

Tested.