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:
Rapptz committed 2021-05-31 05:50:40 -04:00
1 parent 4a3491cc0a
commit d0097c4281
5 files changed
+19 -6

No files matched your search

+2
View File
@@ -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: