#2806·Baileys

[BUG] addTransactionCapability 会在每个套接字上泄露一个已启用的 AsyncLocalStorage — 每创建一个套接字,堆内存成本都会增加

作者: DevAloshe创建于 2026年9月7日更新于 2026年9月20日
标签bug

Describe the bug

addTransactionCapability() (src/Utils/auth-utils.ts) does const txStorage = new AsyncLocalStorage<TransactionContext>() and it is called once per socket from makeSocket (src/Socket/socket.ts). The first transaction() call runs txStorage.run(ctx, work), which enables the storage — and nothing in the codebase ever calls .disable() (grep count: 0, still true on master today).

内容来源: WhiskeySockets/Baileys