Skip to content

Commit f1c91d5

Browse files
committed
fix: harden Slack socket teardown shutdown
1 parent 4d4d77e commit f1c91d5

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ Docs: https://docs.openclaw.ai
610610
- Telegram/forum topics: keep native `/new` and `/reset` routed to the active topic by preserving the topic target on forum-thread command context. (#35963)
611611
- Status/port diagnostics: treat single-process dual-stack loopback gateway listeners as healthy in `openclaw status --all`, suppressing false "port already in use" conflict warnings. (#53398) Thanks @DanWebb1949.
612612
- CLI/Docker: treat loopback private-host CLI gateway connects as local for silent pairing auto-approval, while keeping remote backend and public-host CLI connects behind pairing. (#55113) Thanks @sar618.
613+
- Slack/socket mode: mark the underlying socket client as shutting down before provider stop paths call Bolt teardown so stale-socket restarts stop leaking orphaned ping reconnect loops. (#56646) Thanks @hsiaoa.
613614

614615
## 2026.3.24
615616

extensions/slack/src/monitor/provider.reconnect.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,18 @@ describe("slack socket reconnect helpers", () => {
104104
error: err,
105105
});
106106
});
107+
108+
it("marks the socket client as shutting down before stop runs", async () => {
109+
const app = {
110+
receiver: { client: { shuttingDown: false } },
111+
stop: vi.fn().mockImplementation(async () => {
112+
expect(app.receiver.client.shuttingDown).toBe(true);
113+
}),
114+
};
115+
116+
await __testing.gracefulStopSlackApp(app);
117+
118+
expect(app.stop).toHaveBeenCalledTimes(1);
119+
expect(app.receiver.client.shuttingDown).toBe(true);
120+
});
107121
});

extensions/slack/src/monitor/provider.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ function formatSlackUserResolved(entry: SlackUserResolution): string {
228228
extra: entry.note ? [entry.note] : [],
229229
});
230230
}
231-
232231
export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
233232
const cfg = opts.config ?? loadConfig();
234233
const runtime: RuntimeEnv = opts.runtime ?? createNonExitingRuntime();

0 commit comments

Comments
 (0)