From 24cb9e3f5c1bdbb13aed97d401027c878740dc4f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 May 2020 18:46:16 +0200 Subject: [PATCH] only increment sent counter after successful send otherwise the message doesn't get sent after coming back online --- src/matrix/room/sending/SendQueue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/room/sending/SendQueue.js b/src/matrix/room/sending/SendQueue.js index 958901e4..d4ee9828 100644 --- a/src/matrix/room/sending/SendQueue.js +++ b/src/matrix/room/sending/SendQueue.js @@ -31,7 +31,6 @@ export class SendQueue { while (this._amountSent < this._pendingEvents.length) { const pendingEvent = this._pendingEvents.get(this._amountSent); console.log("trying to send", pendingEvent.content.body); - this._amountSent += 1; if (pendingEvent.remoteId) { continue; } @@ -50,6 +49,7 @@ export class SendQueue { console.log("writing remoteId now"); await this._tryUpdateEvent(pendingEvent); console.log("keep sending?", this._amountSent, "<", this._pendingEvents.length); + this._amountSent += 1; } } catch(err) { if (err instanceof ConnectionError) {