From 6ff5f1714065cfc7930c28c2d0d2348769c174ef Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 2 Aug 2022 13:25:23 +0300 Subject: [PATCH] assume bg is ready if messaging succeeded --- js/msg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/msg.js b/js/msg.js index ba0e65f0..4a6f69b8 100644 --- a/js/msg.js +++ b/js/msg.js @@ -161,8 +161,10 @@ return Promise.reject(e); } await bgReadying; - bgReadying = bgReadySignal = null; return msg.send(m); + } finally { + // Assuming bg is ready if messaging succeeded + bgReadying = bgReadySignal = null; } }