fix(twitch): cancel pending clients during shutdown · openclaw/openclaw@e9bf111
steipete
·
2026-05-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -227,6 +227,19 @@ describe("TwitchClientManager", () => {
|
227 | 227 | await expect(connection).rejects.toThrow("disconnected"); |
228 | 228 | }); |
229 | 229 | |
| 230 | +it("does not cache pending connections after disconnectAll", async () => { |
| 231 | +mockConnect.mockImplementationOnce(() => {}); |
| 232 | + |
| 233 | +const connection = manager.getClient(testAccount); |
| 234 | +await Promise.resolve(); |
| 235 | + |
| 236 | +await manager.disconnectAll(); |
| 237 | +authSuccessHandlers[0]?.(); |
| 238 | + |
| 239 | +await expect(connection).rejects.toThrow("Twitch connection cancelled"); |
| 240 | +expect(mockQuit).toHaveBeenCalledTimes(2); |
| 241 | +}); |
| 242 | + |
230 | 243 | it("should create separate clients for different accounts", async () => { |
231 | 244 | await manager.getClient(testAccount); |
232 | 245 | await manager.getClient(testAccount2); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。