Split a retried drop out of close, and range-check the backoff

`close` fires only where nothing will bring the session back; a drop the
reconnect loop will retry is `disconnected`, pairing with `reconnected`.
`minDelay: 0` never doubles, so the backoff never started — both delays
are range-checked now, and only `false` spells reconnect off.
This commit is contained in:
2026-08-31 21:11:19 +02:00
parent 18177053bc
commit 880454b4f4
6 changed files with 111 additions and 8 deletions
+5 -1
View File
@@ -1408,7 +1408,11 @@ describe('application hooks that throw or reject', () => {
describe('link timers', () => {
test('closes a client link the peer has stopped answering', async t => {
const peer = await bindOnlyPeer(t);
const { err, session } = await client({ enquireLinkInterval: 50, port: peer.port });
const { err, session } = await client({
enquireLinkInterval: 50,
port: peer.port,
reconnect: false,
});
assert.equal(err, undefined);
assert.ok(session);