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; } }