mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Remove view syncing before editing in views
This prevents a potential race condition when a MESSAGE_UPDATE is received syncing and refreshing the view components causing a desync.
This commit is contained in:
1 parent
4a3491cc0a
commit
d0097c4281
5 files changed
+19
-6
No files matched your search
@@ -1216,6 +1216,7 @@ class Message(Hashable):
|
||||
# To check for the view afterwards
|
||||
view = None
|
||||
else:
|
||||
self._state.prevent_view_updates_for(self.id)
|
||||
if view:
|
||||
fields['components'] = view.to_components()
|
||||
else:
|
||||
@@ -1687,6 +1688,7 @@ class PartialMessage(Hashable):
|
||||
# To check for the view afterwards
|
||||
view = None
|
||||
else:
|
||||
self._state.prevent_view_updates_for(self.id)
|
||||
if view:
|
||||
fields['components'] = view.to_components()
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user