From 618a32e6c002c97e4e343a5fbac1da62b4942591 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 20 May 2021 14:49:54 +0200 Subject: [PATCH] revert last tried pending event status to waiting when offline so we don't fail the check if we can immediately remove when redacting --- src/matrix/room/sending/PendingEvent.js | 5 +++++ src/matrix/room/sending/SendQueue.js | 1 + 2 files changed, 6 insertions(+) diff --git a/src/matrix/room/sending/PendingEvent.js b/src/matrix/room/sending/PendingEvent.js index ae51f457..3e7971e7 100644 --- a/src/matrix/room/sending/PendingEvent.js +++ b/src/matrix/room/sending/PendingEvent.js @@ -88,6 +88,11 @@ export class PendingEvent { this._emitUpdate("status"); } + setWaiting() { + this._status = SendStatus.Waiting; + this._emitUpdate("status"); + } + get status() { return this._status; } get error() { return this._error; } diff --git a/src/matrix/room/sending/SendQueue.js b/src/matrix/room/sending/SendQueue.js index fd8c45c1..c946a2f5 100644 --- a/src/matrix/room/sending/SendQueue.js +++ b/src/matrix/room/sending/SendQueue.js @@ -74,6 +74,7 @@ export class SendQueue { if (err instanceof ConnectionError) { this._offline = true; log.set("offline", true); + pendingEvent.setWaiting(); } else { log.catch(err); pendingEvent.setError(err);