diff -r 433a1f36d0d3 -r 2c17151ed21b scansion/objects/client.lua --- a/scansion/objects/client.lua Thu Mar 23 11:51:31 2023 +0000 +++ b/scansion/objects/client.lua Thu Mar 23 12:14:53 2023 +0000 @@ -107,7 +107,12 @@ end client.stream:hook("stanza", stanza_handler, 100); verse.add_task(client.stanza_timeout or default_stanza_timeout, function () - if have_received_stanza then return; end + done(); + end); + client.stream.conn:resume(); + wait(); + + if not have_received_stanza then if expected_stanza then client.log("TIMEOUT waiting for %s", expected_stanza) local e = new_error("stanza-timeout", { text = "Timed out waiting for stanza" }); @@ -117,9 +122,7 @@ client.log("Good - no stanzas were received (expected)"); done(); end - end); - client.stream.conn:resume(); - wait(); + end end; disconnects = function (client)