From 89f3006387c5a532676cae41f52e3f17de6f93a5 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 8 Oct 2020 13:27:21 -0700 Subject: [PATCH 1/4] healthcheck --- app.ts | 1 + dist/app.js | 1 + dist/app.js.map | 2 +- dist/src/controllers/bots.js | 3 +- dist/src/controllers/bots.js.map | 2 +- dist/src/controllers/confirmations.js | 56 +++++++++++++++++++ dist/src/controllers/confirmations.js.map | 2 +- dist/src/controllers/index.js | 3 +- dist/src/controllers/index.js.map | 2 +- dist/src/network/intercept.js | 7 +-- dist/src/network/intercept.js.map | 2 +- src/controllers/bots.ts | 3 +- src/controllers/confirmations.ts | 65 +++++++++++++++++++++-- src/controllers/index.ts | 4 +- src/network/intercept.ts | 7 +-- 15 files changed, 141 insertions(+), 19 deletions(-) diff --git a/app.ts b/app.ts index 708641a..2f3503a 100644 --- a/app.ts +++ b/app.ts @@ -91,6 +91,7 @@ async function authModule(req, res, next) { req.path == '/action' || req.path == '/contacts/tokens' || req.path == '/latest' || + req.path == '/healthcheck' || req.path.startsWith('/static') || req.path == '/contacts/set_dev' ) { diff --git a/dist/app.js b/dist/app.js index 562c7cc..0c0b3a9 100644 --- a/dist/app.js +++ b/dist/app.js @@ -99,6 +99,7 @@ function authModule(req, res, next) { req.path == '/action' || req.path == '/contacts/tokens' || req.path == '/latest' || + req.path == '/healthcheck' || req.path.startsWith('/static') || req.path == '/contacts/set_dev') { next(); diff --git a/dist/app.js.map b/dist/app.js.map index 4990906..2b68da4 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,6BAA4B;AAC5B,iCAAgC;AAChC,6BAA4B;AAC5B,yCAAmC;AACnC,+CAAuC;AACvC,mCAAkE;AAClE,6CAA0D;AAC1D,iDAAgD;AAChD,6C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AC;YAC/E,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,IAAI,IAAI,CAAC,SAAS,IAAI,WAAW,EAAE;gBAC5D,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,yBAAyB,EAAE,EAAC,cAAc,EAAG,YAAY,EAAC,CAAC,CAAC;gBAC/E,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;aAC/B;iBAAM;gBACN,IAAI,EAAE,CAAC;aACP;SACD;IACF,CAAC;CAAA;AAED,kBAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/bots.js b/dist/src/controllers/bots.js index 6b60434..55e4990 100644 --- a/dist/src/controllers/bots.js +++ b/dist/src/controllers/bots.js @@ -270,9 +270,10 @@ function postToBotServer(msg, bot, route) { } exports.postToBotServer = postToBotServer; function buildBotPayload(msg) { + const chat_uuid = msg.chat && msg.chat.uuid; const m = { channel: { - id: msg.chat.uuid, + id: chat_uuid, send: function () { }, }, reply: function () { }, diff --git a/dist/src/controllers/bots.js.map b/dist/src/controllers/bots.js.map index f4aa204..b7120dd 100644 --- a/dist/src/controllers/bots.js.map +++ b/dist/src/controllers/bots.js.map @@ -1 +1 @@ -{"version":3,"file":"bots.js","sourceRoot":"","sources":["../../../src/controllers/bots.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,0CAAyC;AACzC,iCAAgC;AAChC,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,+BAAwC;AACxC,0CAAyC;AACzC,2CAA8B;AAC9B,wCAAuC;AAGvC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAEjE,QAAA,OAAO,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACxC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QACvC,aA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E,QAAQ;gBACd,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO;gBACrC,MAAM,EAAE,CAAC,MAAM,IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;gBAChC,MAAM,EAAE,MAAM,IAAI,CAAC;gBACnB,IAAI,EAAE,IAAI;gBACV,cAAc,EAAE,OAAO;gBACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS;gBACpC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,YAAY,IAAI,KAAK;aACnC,CAAA;YACD,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChD,MAAM,CAAC,QAAQ,CAAC;gBACd,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;aAC3D,CAAC,CAAA;SACH;IACH,CAAC;CAAA;AAhED,sCAgEC"} \ No newline at end of file +{"version":3,"file":"bots.js","sourceRoot":"","sources":["../../../src/controllers/bots.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,0CAAyC;AACzC,iCAAgC;AAChC,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,+BAAwC;AACxC,0CAAyC;AACzC,2CAA8B;AAC9B,wCAAuC;AAGvC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAEjE,QAAA,OAAO,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACxC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QACvC,aAAO,CAAC,GAAG,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC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,SAAS,CAAC,aAAa,CAAC,OAAO;gBACrC,MAAM,EAAE,CAAC,MAAM,IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;gBAChC,MAAM,EAAE,MAAM,IAAI,CAAC;gBACnB,IAAI,EAAE,IAAI;gBACV,cAAc,EAAE,OAAO;gBACvB,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS;gBACpC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,YAAY,IAAI,KAAK;aACnC,CAAA;YACD,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChD,MAAM,CAAC,QAAQ,CAAC;gBACd,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;aAC3D,CAAC,CAAA;SACH;IACH,CAAC;CAAA;AAhED,sCAgEC"} \ No newline at end of file diff --git a/dist/src/controllers/confirmations.js b/dist/src/controllers/confirmations.js index f218f3b..0a0a799 100644 --- a/dist/src/controllers/confirmations.js +++ b/dist/src/controllers/confirmations.js @@ -15,6 +15,7 @@ const socket = require("../utils/socket"); const jsonUtils = require("../utils/json"); const network = require("../network"); const path = require("path"); +const res_1 = require("../utils/res"); const constants = require(path.join(__dirname, '../../config/constants.json')); function sendConfirmation({ chat, sender, msg_id }) { if (!msg_id) @@ -146,4 +147,59 @@ function receiveHeartbeat(payload) { }); } exports.receiveHeartbeat = receiveHeartbeat; +let heartbeats = {}; +function healthcheck(req, res) { + return __awaiter(this, void 0, void 0, function* () { + const pubkey = req.query.pubkey; + if (!(pubkey && pubkey.length === 66)) { + return res_1.failure(res, 'missing pubkey'); + } + const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); + const amt = 10; + const opts = { + amt, + dest: pubkey, + data: { + type: constants.message_types.heartbeat, + message: { + amount: amt, + }, + sender: { pub_key: owner.publicKey } + } + }; + try { + yield network.signAndSend(opts); + } + catch (e) { + res_1.failure(res, e); + return; + } + let i = 0; + let interval = setInterval(() => { + if (i >= 15) { + clearInterval(interval); + delete heartbeats[pubkey]; + res_1.failure(res, 'no confimration received'); + return; + } + if (heartbeats[pubkey]) { + res_1.success(res, 'success'); + clearInterval(interval); + delete heartbeats[pubkey]; + return; + } + i++; + }, 1000); + }); +} +exports.healthcheck = healthcheck; +function receiveHeartbeatConfirmation(payload) { + return __awaiter(this, void 0, void 0, function* () { + console.log('=> received heartbeat confirmation'); + const dat = payload.content || payload; + const sender_pub_key = dat.sender.pub_key; + heartbeats[sender_pub_key] = true; + }); +} +exports.receiveHeartbeatConfirmation = receiveHeartbeatConfirmation; //# sourceMappingURL=confirmations.js.map \ No newline at end of file diff --git a/dist/src/controllers/confirmations.js.map b/dist/src/controllers/confirmations.js.map index 58ae70c..bf115f9 100644 --- a/dist/src/controllers/confirmations.js.map +++ b/dist/src/controllers/confirmations.js.map @@ -1 +1 @@ -{"version":3,"file":"confirmations.js","sourceRoot":"","sources":["../../../src/controllers/confirmations.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAgC;AAChC,sCAAkC;AAClC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,6BAA4B;AAE5B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAE9E,SAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;IACxD,IAAI,CAAC,MAAM;QAAE,OAAM;IACnB,OAAO,CAAC,WAAW,CAAC;QACnB,IAAI;QACJ,MAAM;QACN,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACvB,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,YAAY;KAC1C,CAAC,CAAA;AACH,CAAC;AARD,4CAQC;AAED,SAAsB,mBAAmB,CAAC,OAAO;;QAChD,O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M,cAAc,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAA;QAEzC,IAAI,CAAC,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,KAAG,EAAE,CAAC;YAAE,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACpF,IAAI,CAAC,cAAc;YAAE,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAEpD,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAExE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAC,CAAC,CAAC,CAAA;QAC3C,MAAM,QAAQ,GAAG,CAAC,CAAA;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAA;QACxC,MAAM,IAAI,GAAG;YACZ,GAAG;YACH,IAAI,EAAC,cAAc;YACnB,IAAI,EAAe;gBAClB,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,sBAAsB;gBACpD,OAAO,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE;gBACxB,MAAM,EAAE,EAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAC;aAClC;SACD,CAAA;QACD,IAAI;YACH,MAAM,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAC/B,OAAO,IAAI,CAAA;SACX;QAAC,OAAO,CAAC,EAAE;YACX,OAAO,KAAK,CAAA;SACZ;IACF,CAAC;CAAA;AA9BD,4CA8BC"} \ No newline at end of file +{"version":3,"file":"confirmations.js","sourceRoot":"","sources":["../../../src/controllers/confirmations.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAgC;AAChC,sCAAkC;AAClC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,6BAA4B;AAC5B,sCAA+C;AAE/C,MAA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;gBACvB,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;gBACzB,aAAO,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAA;gBACxC,OAAM;aACP;YACD,IAAG,UAAU,CAAC,MAAM,CAAC,EAAE;gBACrB,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;gBACvB,aAAa,CAAC,QAAQ,CAAC,CAAA;gBACvB,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;gBACzB,OAAM;aACP;YACD,CAAC,EAAG,CAAA;QACN,CAAC,EAAE,IAAI,CAAC,CAAA;IAEV,CAAC;CAAA;AA5CD,kCA4CC;AAED,SAAsB,4BAA4B,CAAC,OAAO;;QACxD,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;QAElD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAA;QACtC,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAA;QAExC,UAAU,CAAC,cAAc,CAAC,GAAG,IAAI,CAAA;IACnC,CAAC;CAAA;AAPD,oEAOC"} \ No newline at end of file diff --git a/dist/src/controllers/index.js b/dist/src/controllers/index.js index ea13610..c20ddaf 100644 --- a/dist/src/controllers/index.js +++ b/dist/src/controllers/index.js @@ -97,6 +97,7 @@ function set(app) { app.get('/bots', bots.getBots); app.post('/bot', bots.createBot); app.delete('/bot/:id', bots.deleteBot); + app.get('/healthcheck', confirmations.healthcheck); app.get('/version', function (req, res) { return __awaiter(this, void 0, void 0, function* () { const version = yield gitinfo_1.checkTag(); @@ -148,6 +149,6 @@ exports.ACTIONS = { [msgtypes.bot_cmd]: bots.receiveBotCmd, [msgtypes.bot_res]: bots.receiveBotRes, [msgtypes.heartbeat]: confirmations.receiveHeartbeat, - [msgtypes.heartbeat_confirmation]: () => { }, + [msgtypes.heartbeat_confirmation]: confirmations.receiveHeartbeatConfirmation, }; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/src/controllers/index.js.map b/dist/src/controllers/index.js.map index 221ca7f..ce4238e 100644 --- a/dist/src/controllers/index.js.map +++ b/dist/src/controllers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,iCAAgC;AAChC,8CAAyC;AACzC,6BAA4B;AAC5B,0CAAyC;AACzC,0CAAyC;AAEzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,GAAG,CAAC,GAAG;;QAE5B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,KAAK,CAAC,eAAe,EAAE,CAAA;SAC7B;QAAC,OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC7D;QAED,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;QACzC,GAAG,CAAC,GAAG,CAAC,Y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CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,GAAE,EAAE,GAAC,CAAC;CACzC,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,iCAAgC;AAChC,8CAAyC;AACzC,6BAA4B;AAC5B,0CAAyC;AACzC,0CAAyC;AAEzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,GAAG,CAAC,GAAG;;QAE5B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,KAAK,CAAC,eAAe,EAAE,CAAA;SAC7B;QAAC,OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC7D;QAED,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,GAAG,CAAC,GAAG,CAAC,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1D,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,mBAAmB;IACxD,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,kBAAkB;IACtD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB;IAC9C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;CAC7E,CAAA"} \ No newline at end of file diff --git a/dist/src/network/intercept.js b/dist/src/network/intercept.js index 2b8a4ca..fd0f4aa 100644 --- a/dist/src/network/intercept.js +++ b/dist/src/network/intercept.js @@ -27,10 +27,11 @@ function isBotMsg(msg, sentByMe) { if (msgType === constants.message_types.bot_res) { return false; // bot res msg type not for processing } + const uuid = msg.chat && msg.chat.uuid; + if (!uuid) + return false; const chat = yield models_1.models.Chat.findOne({ - where: { - uuid: msg.chat.uuid - } + where: { uuid } }); if (!chat) return false; diff --git a/dist/src/network/intercept.js.map b/dist/src/network/intercept.js.map index 9188d9c..a9ebaed 100644 --- a/dist/src/network/intercept.js.map +++ b/dist/src/network/intercept.js.map @@ -1 +1 @@ -{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../src/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,wCAA2C;AAC3C,8CAAoE;AACpE,6BAA4B;AAC5B,wCAAuC;AAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAE9E;;;EAGE;AAEF,kDAAkD;AAClD,SAAsB,QAAQ,CAAC,GAAQ,EAAE,QAAiB;;QACxD,MAAM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;YACvC;gBACE,OAAO,KAAK,CAAA;SACf;IACH,CAAC;CAAA;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACjD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../src/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,wCAA2C;AAC3C,8CAAoE;AACpE,6BAA4B;AAC5B,wCAAuC;AAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAE9E;;;EAGE;AAEF,kDAAkD;AAClD,SAAsB,QAAQ,CAAC,GAAQ,EAAE,QAAiB;;QACxD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAA;QAE9C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAA;QACxB,IAAI,OAAO,KAAK,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE;YAC/C,OAAO,KAAK,CAAA,CAAC,sCAAsC;SACpD;QACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QACtC,IAAG,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEtB,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,EAAC,IAAI,EAAC;SACd,CAAC,CAAA;QACF,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEvB,IAAI,OAAO,GAAG,KAAK,CAAA;QAEnB,IAAI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AG,MAAM,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;iBAC7D;aACF;QACH,CAAC,CAAA,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAtDD,4BAsDC;AAED,SAAe,gBAAgB,CAAC,GAAG,EAAE,UAAU;;QAC7C,gEAAgE;QAChE,QAAQ,UAAU,CAAC,OAAO,EAAE;YAC1B,KAAK,SAAS,CAAC,SAAS,CAAC,OAAO;gBAC9B,wBAAc,CAAC,GAAG,CAAC,CAAA;gBACnB,OAAO,IAAI,CAAA;YACb,KAAK,SAAS,CAAC,SAAS,CAAC,KAAK;gBAC5B,MAAM,GAAG,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,CAAC;oBACnC,KAAK,EAAE;wBACL,IAAI,EAAE,UAAU,CAAC,OAAO;qBACzB;iBACF,CAAC,CAAA;gBACF,OAAO,sBAAe,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,KAAK,SAAS,CAAC,SAAS,CAAC,MAAM;gBAC7B,OAAO,oBAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;YACvC;gBACE,OAAO,KAAK,CAAA;SACf;IACH,CAAC;CAAA;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACjD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/src/controllers/bots.ts b/src/controllers/bots.ts index 73cd2c8..37aa6e5 100644 --- a/src/controllers/bots.ts +++ b/src/controllers/bots.ts @@ -261,9 +261,10 @@ export async function postToBotServer(msg, bot, route:string): Promise } export function buildBotPayload(msg:Msg): SphinxBot.Message { + const chat_uuid = msg.chat&&msg.chat.uuid const m = { channel:{ - id: msg.chat.uuid, + id: chat_uuid, send:function(){}, }, reply:function(){}, diff --git a/src/controllers/confirmations.ts b/src/controllers/confirmations.ts index f8d94ee..757b30e 100644 --- a/src/controllers/confirmations.ts +++ b/src/controllers/confirmations.ts @@ -4,6 +4,7 @@ import * as socket from '../utils/socket' import * as jsonUtils from '../utils/json' import * as network from '../network' import * as path from 'path' +import { failure, success } from '../utils/res' const constants = require(path.join(__dirname, '../../config/constants.json')) @@ -108,21 +109,21 @@ export async function receiveHeartbeat(payload) { const sender_pub_key = dat.sender.pub_key const receivedAmount = dat.message.amount - if (!(sender_pub_key && sender_pub_key.length===66)) return console.log('no sender') + if (!(sender_pub_key && sender_pub_key.length === 66)) return console.log('no sender') if (!receivedAmount) return console.log('no amount') const owner = await models.Contact.findOne({ where: { isOwner: true } }) - const amount = Math.round(receivedAmount/2) + const amount = Math.round(receivedAmount / 2) const MIN_SATS = 3 const amt = Math.max(amount || MIN_SATS) const opts = { amt, - dest:sender_pub_key, + dest: sender_pub_key, data: { type: constants.message_types.heartbeat_confirmation, message: { amount: amt }, - sender: {pub_key: owner.publicKey} + sender: { pub_key: owner.publicKey } } } try { @@ -131,4 +132,60 @@ export async function receiveHeartbeat(payload) { } catch (e) { return false } +} + +let heartbeats:{[k:string]:boolean} = {} +export async function healthcheck(req, res) { + const pubkey:string = req.query.pubkey + if (!(pubkey&&pubkey.length===66)) { + return failure(res, 'missing pubkey') + } + + const owner = await models.Contact.findOne({ where: { isOwner: true } }) + + const amt = 10 + const opts = { + amt, + dest: pubkey, + data: { + type: constants.message_types.heartbeat, + message: { + amount: amt, + }, + sender: { pub_key: owner.publicKey } + } + } + try { + await network.signAndSend(opts) + } catch (e) { + failure(res, e) + return + } + + let i = 0 + let interval = setInterval(()=>{ + if(i>=15) { + clearInterval(interval) + delete heartbeats[pubkey] + failure(res, 'no confimration received') + return + } + if(heartbeats[pubkey]) { + success(res, 'success') + clearInterval(interval) + delete heartbeats[pubkey] + return + } + i ++ + }, 1000) + +} + +export async function receiveHeartbeatConfirmation(payload) { + console.log('=> received heartbeat confirmation') + + const dat = payload.content || payload + const sender_pub_key = dat.sender.pub_key + + heartbeats[sender_pub_key] = true } \ No newline at end of file diff --git a/src/controllers/index.ts b/src/controllers/index.ts index 61fbe97..9e26e53 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -101,6 +101,8 @@ export async function set(app) { app.post('/bot', bots.createBot) app.delete('/bot/:id', bots.deleteBot) + app.get('/healthcheck', confirmations.healthcheck) + app.get('/version', async function(req,res) { const version = await checkTag() res.send({version}) @@ -148,5 +150,5 @@ export const ACTIONS = { [msgtypes.bot_cmd]: bots.receiveBotCmd, [msgtypes.bot_res]: bots.receiveBotRes, [msgtypes.heartbeat]: confirmations.receiveHeartbeat, - [msgtypes.heartbeat_confirmation]: ()=>{}, + [msgtypes.heartbeat_confirmation]: confirmations.receiveHeartbeatConfirmation, } diff --git a/src/network/intercept.ts b/src/network/intercept.ts index d73fd92..869a1fe 100644 --- a/src/network/intercept.ts +++ b/src/network/intercept.ts @@ -20,10 +20,11 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { if (msgType === constants.message_types.bot_res) { return false // bot res msg type not for processing } + const uuid = msg.chat && msg.chat.uuid + if(!uuid) return false + const chat = await models.Chat.findOne({ - where: { - uuid: msg.chat.uuid - } + where: {uuid} }) if (!chat) return false From 1127b115a10f35b78e3cf1dceeecb65288716610 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 8 Oct 2020 14:01:31 -0700 Subject: [PATCH 2/4] workin --- app.ts | 1 - dist/app.js | 1 - dist/app.js.map | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app.ts b/app.ts index 2f3503a..708641a 100644 --- a/app.ts +++ b/app.ts @@ -91,7 +91,6 @@ async function authModule(req, res, next) { req.path == '/action' || req.path == '/contacts/tokens' || req.path == '/latest' || - req.path == '/healthcheck' || req.path.startsWith('/static') || req.path == '/contacts/set_dev' ) { diff --git a/dist/app.js b/dist/app.js index 0c0b3a9..562c7cc 100644 --- a/dist/app.js +++ b/dist/app.js @@ -99,7 +99,6 @@ function authModule(req, res, next) { req.path == '/action' || req.path == '/contacts/tokens' || req.path == '/latest' || - req.path == '/healthcheck' || req.path.startsWith('/static') || req.path == '/contacts/set_dev') { next(); diff --git a/dist/app.js.map b/dist/app.js.map index 2b68da4..4990906 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,6BAA4B;AAC5B,iCAAgC;AAChC,6BAA4B;AAC5B,yCAAmC;AACnC,+CAAuC;AACvC,mCAAkE;AAClE,6CAA0D;AAC1D,iDAAgD;AAChD,6CAA4C;AAC5C,yCAAwC;AAExC,IAAI,MAAM,GAAQ,IAAI,CAAA;AACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACrE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAA,CAAC,gCAAgC;AAEtE,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,YAAY,CAAA;AAEjD,IAAI,CAAC,GAAG,CAAC,CAAA;AAET,eAAe;AACf,YAAY,EAAE,CAAA;AAEd,SAAe,YAAY;;QAC1B,CAAC,EAAE,CAAA;QACH,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAA;QACnD,IAAI;YACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA,CAAG,MA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I,EAAE,CAAA;gBACN,OAAM;aACN;SACD;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QAExE,IAAI,KAAK,IAAI,IAAI,EAAE;YAClB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,yBAAyB,EAAE,EAAC,cAAc,EAAG,YAAY,EAAC,CAAC,CAAC;YAC5E,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;SAClC;aAAM;YACN,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;YACtE,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC/E,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,IAAI,IAAI,CAAC,SAAS,IAAI,WAAW,EAAE;gBAC5D,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,yBAAyB,EAAE,EAAC,cAAc,EAAG,YAAY,EAAC,CAAC,CAAC;gBAC/E,GAAG,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;aAC/B;iBAAM;gBACN,IAAI,EAAE,CAAC;aACP;SACD;IACF,CAAC;CAAA;AAED,kBAAe,MAAM,CAAA"} \ No newline at end of file From 57ede8aeda8039c16537a03509e5377c399d1ecc Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 8 Oct 2020 16:34:30 -0700 Subject: [PATCH 3/4] fix date panic in case.ts --- dist/src/utils/case.js | 4 +++- dist/src/utils/case.js.map | 2 +- src/utils/case.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/src/utils/case.js b/dist/src/utils/case.js index 61cb8b6..bad2855 100644 --- a/dist/src/utils/case.js +++ b/dist/src/utils/case.js @@ -8,7 +8,9 @@ function toSnake(obj) { for (let [key, value] of Object.entries(obj)) { if (dateKeys.includes(key) && value) { const v = value; - const d = new Date(v); + let d = new Date(v); + if (isNaN(d.getTime())) + d = new Date(); ret[changeCase.snakeCase(key)] = d.toISOString(); } else if (boolKeys.includes(key)) { diff --git a/dist/src/utils/case.js.map b/dist/src/utils/case.js.map index 0712b5a..a7f4a42 100644 --- a/dist/src/utils/case.js.map +++ b/dist/src/utils/case.js.map @@ -1 +1 @@ -{"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/utils/case.ts"],"names":[],"mappings":";;AAAA,0CAA0C;AAE1C,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAC,WAAW,EAAC,WAAW,EAAC,YAAY,EAAC,YAAY,CAAC,CAAA;AAC3E,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAC,SAAS,EAAC,SAAS,CAAC,CAAA;AAElD,SAAS,OAAO,CAAC,GAAG;IAChB,MAAM,GAAG,GAAuB,EAAE,CAAA;IAClC,KAAK,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC1C,IAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,EAAC;YAC/B,MAAM,CAAC,GAAQ,KAAK,CAAA;YACpB,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAA;YACrB,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;SACnD;aAAM,IAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC9B,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAE,KAAK,KAAG,GAAG,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA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AAW,EAAE,CAAA;SACnD;aAAM,IAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC9B,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAE,KAAK,KAAG,GAAG,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA,CAAC,CAAA;SAC7D;aAAM;YACH,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAA;SACzC;KACJ;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAUO,0BAAO;AARf,SAAS,OAAO,CAAC,GAAG;IAChB,MAAM,GAAG,GAAuB,EAAE,CAAA;IAClC,KAAK,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC1C,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAA;KACzC;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAEgB,0BAAO"} \ No newline at end of file diff --git a/src/utils/case.ts b/src/utils/case.ts index 65e5de2..4f8a9e2 100644 --- a/src/utils/case.ts +++ b/src/utils/case.ts @@ -8,7 +8,8 @@ function toSnake(obj) { for (let [key, value] of Object.entries(obj)) { if(dateKeys.includes(key) && value){ const v: any = value - const d = new Date(v) + let d = new Date(v) + if(isNaN(d.getTime())) d=new Date() ret[changeCase.snakeCase(key)] = d.toISOString() } else if(boolKeys.includes(key)) { ret[changeCase.snakeCase(key)] = (!value||value==='0')?0:1 From 84a69d61d75bd4d0b6b33d0fb41e879b4b71a834 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 8 Oct 2020 16:38:14 -0700 Subject: [PATCH 4/4] fix date panic --- dist/src/controllers/chatTribes.js | 5 ++++- dist/src/controllers/chatTribes.js.map | 2 +- src/controllers/chatTribes.ts | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dist/src/controllers/chatTribes.js b/dist/src/controllers/chatTribes.js index 984b87c..1e8572e 100644 --- a/dist/src/controllers/chatTribes.js +++ b/dist/src/controllers/chatTribes.js @@ -438,7 +438,10 @@ function replayChatHistory(chat, contact) { content = JSON.parse(m.remoteMessageContent); } catch (e) { } - const dateString = m.date && m.date.toISOString(); + let mdate = m.date; + if (!mdate) + mdate = new Date(); + const dateString = mdate.toISOString(); let mediaKeyMap; let newMediaTerms; if (m.type === constants.message_types.attachment) { diff --git a/dist/src/controllers/chatTribes.js.map b/dist/src/controllers/chatTribes.js.map index 3a49e54..43b169f 100644 --- a/dist/src/controllers/chatTribes.js.map +++ b/dist/src/controllers/chatTribes.js.map @@ -1 +1 @@ -{"version":3,"file":"chatTribes.js","sourceRoot":"","sources":["../../../src/controllers/chatTribes.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,qCAAoC;AACpC,sCAAqC;AACrC,0CAAyC;AACzC,0CAAyC;AACzC,6BAA4B;AAC5B,gCAAyC;AACzC,sCAA+D;AAC/D,yCAA8B;AAE9B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,SAAS,CAAC,GAAG,EAAE,GAAG;;QACvC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAC3B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QACxF,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAA;QAEnC,MAAM,QAAQ,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,EAA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M,CAAC,UAAU,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBACtD,MAAM,EAAE,KAAK,CAAC,EAAE;gBAChB,MAAM,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,eAAe;aACvD,EAAC,CAAC,CAAA;QACH,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAA;QAC1B,MAAM,iBAAiB,GAAY,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,SAAS,CAAC,CAAA;QAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,IAAE,KAAK,CAAA;QACpC,uCACI,IAAI,KACP,iBAAiB,IACjB;IACF,CAAC;CAAA;AAZD,gEAYC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/src/controllers/chatTribes.ts b/src/controllers/chatTribes.ts index 5e5432e..448afa5 100644 --- a/src/controllers/chatTribes.ts +++ b/src/controllers/chatTribes.ts @@ -440,7 +440,10 @@ export async function replayChatHistory(chat, contact) { let content = '' try {content = JSON.parse(m.remoteMessageContent)} catch(e) {} - const dateString = m.date&&m.date.toISOString() + let mdate = m.date + if(!mdate) mdate = new Date() + const dateString = mdate.toISOString() + let mediaKeyMap let newMediaTerms if(m.type===constants.message_types.attachment) {