clawgram 2.17.0 → 2.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,10 +238,25 @@ class GramJsClientManager {
238
238
  }
239
239
  this.started = true;
240
240
  }
241
+ /**
242
+ * Tears the client down for good.
243
+ *
244
+ * `destroy()`, not `disconnect()`. GramJS runs its update loop as
245
+ * `while (!client._destroyed)` (telegram/client/updates.js), and only
246
+ * `destroy()` sets that flag — `disconnect()` drops the connection and
247
+ * leaves the loop spinning, retrying and logging `Error: TIMEOUT` forever.
248
+ * The manager is thrown away on stop, so losing the event handlers that
249
+ * `destroy()` clears is exactly what we want.
250
+ *
251
+ * This leak was invisible while a config write restarted the whole Gateway.
252
+ * 2.17.0 made channel restarts routine, and the rate then grew by one loop
253
+ * per restart — measured on the owner's server 2026-08-15: ~3 timeouts/min
254
+ * before a restart, ~4.5/min after one.
255
+ */
241
256
  async stop() {
242
257
  if (!this.started)
243
258
  return;
244
- await this.client.disconnect();
259
+ await this.client.destroy();
245
260
  this.started = false;
246
261
  }
247
262
  getClient() {
@@ -2,7 +2,7 @@
2
2
  "id": "clawgram",
3
3
  "name": "Clawgram",
4
4
  "description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
5
- "version": "2.17.0",
5
+ "version": "2.17.1",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawgram",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {