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
2021-05-31 05:47:46 -04:00
parent 4a3491cc0a
commit d0097c4281
5 changed files with 19 additions and 6 deletions

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: