From d717135148d8c7a34e05a9c220f0d1c36b2c4abc Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 4 Feb 2021 00:03:51 -0800 Subject: [PATCH] More push messaging fixes. --- firebase.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firebase.js b/firebase.js index 72add8ad..08a98341 100644 --- a/firebase.js +++ b/firebase.js @@ -242,11 +242,13 @@ module.exports.CreateFirebaseRelay = function (parent, url, key) { // If the web socket is open, send now if (obj.wsopen == true) { - try { obj.wsclient.send(JSON.stringify({ pmt: node.pmt, payload: payload, options: options })); } catch (ex) { func(0, 'error'); return; } + try { obj.wsclient.send(JSON.stringify({ pmt: node.pmt, payload: payload, options: options })); } catch (ex) { func(0, 'error'); obj.stats.sendError++; return; } + obj.stats.sent++; func(1); } else { // TODO: Buffer the push messages until TTL. func(0, 'error'); + obj.stats.sendError++; } } obj.connectWebSocket();