github windkh/node-red-contrib-telegrambot V17.4.6

5 hours ago

V17.4.6 — verbose-logging checkbox now actually honoured

Direct fix for @Bobo-amg's observation on #411: the UI checkbox showed Verbose Logging — UNCHECKED, but every verbose-gated self.warn(...) was firing anyway during network blips, flooding the log with a formatErrorChain line, the full util.inspect dump, and the trailing Polling error --> Trying again tail.

What was happening

bot-node.js read the config field with no coercion:

this.verbose = n.verboselogging;

n.verboselogging is bound to an HTML checkbox so it should be a strict boolean, but flows.json can carry the value as the string 'false' in any of these situations:

  • the config was hand-edited (or programmatically generated)
  • the flow was imported from an export produced by certain older Node-RED versions
  • a script touched the config and stringified the boolean somewhere along the way

if ("false") is truthy in JavaScript. So once a 'false' string snuck in, every if (self.verbose) { ... } branch fired regardless of the UI state.

What changes in V17.4.6

One-line coerce at bot-node.js:314:

this.verbose = !!n.verboselogging && n.verboselogging !== 'false';

Truth table — only the buggy case changes behaviour:

n.verboselogging before V17.4.6 V17.4.6
true truthy ✓ true ✓
false falsy ✓ false ✓
undefined falsy ✓ false ✓
"true" truthy ✓ true ✓
"false" truthy (BUG) false ✓
"on" truthy true
"" falsy false

If you've been seeing verbose-style output despite an unchecked checkbox, upgrade and the behaviour should snap into line with the UI on next deploy. No need to touch the checkbox.

Tests

223 passing (up from 222 in V17.4.5). One new mocha case in test/nodes/bot-node.test.js parameterises all seven input shapes from the truth table above.

What this does NOT fix

The underlying connectivity issues that triggered the verbose output — connect ETIMEDOUT, connect EACCES on IPv6, etc. — are network-layer and out of scope. The V17.4.5 release notes still apply for those. V17.4.6 just makes sure that when you intentionally turn verbose off, it actually stays off.

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

NewReleases is sending notifications on new releases.