From 8ee1a77d16b9b0ab13655a39b809314425b4ac53 Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Wed, 11 Nov 2020 20:41:17 +0700 Subject: [PATCH] Only clear backlog_pending flag if the error is an instance of RoomMessagesError --- matrix/server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix/server.py b/matrix/server.py index d1becdb..d02c827 100644 --- a/matrix/server.py +++ b/matrix/server.py @@ -60,6 +60,7 @@ from nio import ( DeleteDevicesResponse, TransportType, RoomMessagesResponse, + RoomMessagesError, EncryptionError, GroupEncryptionError, OlmTrustError, @@ -1618,8 +1619,9 @@ class MatrixServer(object): if isinstance(response, ErrorResponse): self.handle_error_response(response) - room_buffer = self.room_buffers[response.room_id] - room_buffer.backlog_pending = False + if isinstance(response, RoomMessagesError): + room_buffer = self.room_buffers[response.room_id] + room_buffer.backlog_pending = False elif isinstance(response, ToDeviceResponse): try: