From a6c9f857e4de48c7d9b709c3a3a646abbeb7d8d1 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 7 Dec 2022 16:14:55 -0400 Subject: [PATCH] fix: increase pairing timeout to 2m --- example/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example/index.js b/example/index.js index ebb8133..3786542 100644 --- a/example/index.js +++ b/example/index.js @@ -78,10 +78,13 @@ async function main() { console.log("Initiator"); const pairingObj = new noise.WakuPairing(sender, receiver, myStaticKey, pairingParameters); + const pExecute = pairingObj.execute(120000); // timeout after 2m + confirmAuthCodeFlow(pairingObj); + try { console.log("executing handshake..."); - const codecs = await pairingObj.execute(); + const codecs = await pExecute; alert("Handshake completed!"); // TODO: enable a form so users can send messages } catch (err) { @@ -103,7 +106,7 @@ async function main() { console.log("Receiver"); const pairingObj = new noise.WakuPairing(sender, receiver, myStaticKey, new noise.ReceiverParameters()); - const pExecute = pairingObj.execute(); + const pExecute = pairingObj.execute(120000); // timeout after 2m confirmAuthCodeFlow(pairingObj);