npm node-red-contrib-telegrambot 17.4.17
V17.4.17

5 hours ago

V17.4.17

Fixes Error stopping node: Close timed out on every Node-RED redeploy in polling mode (#463, PR #464 by @ajanulis).

What was wrong

The close path called stopPolling({ cancel: false }), which in node-telegram-bot-api@0.66.0 returns lastRequest.finally(...) — waiting up to the hardcoded 10s pollTimeout for the in-flight long-poll to settle. The manual _lastRequest.cancel('abortBot') doesn't reliably abort the underlying @cypress/request-promise socket, so on a busy multi-node flow total close time crossed Node-RED's 15s nodeCloseTimeout.

Fix

In abortBot, set polling._abort = true directly (the recursive-setTimeout disarm that cancel:false used to provide) and switch to stopPolling({ cancel: true }), which returns immediately. Both halves matter: _abort = true prevents the recursive poll loop from rescheduling (the 409-Conflict race cancel:true alone hit in V17.3.0), and cancel:true avoids the up-to-10s wait. Deploy close time drops from ~12–15s to <1s.

V17-only — the V18 line already uses stopPolling({ cancel: true }) against lib 1.x, which handles both halves internally.

Thanks to @ajanulis for the precise root-cause analysis, before/after timing, and tests.

npm install node-red-contrib-telegrambot@17.4.17

Don't miss a new node-red-contrib-telegrambot release

NewReleases is sending notifications on new releases.