Slack: infer interaction channel type from channel ID

This commit is contained in:
Colin
2026-02-16 12:27:58 -05:00
committed by Peter Steinberger
parent 378e18b75b
commit e023c84d78
2 changed files with 6 additions and 2 deletions

View File

@@ -87,7 +87,7 @@ function createContext() {
describe("registerSlackInteractionEvents", () => {
it("enqueues structured events and updates button rows", async () => {
enqueueSystemEventMock.mockReset();
const { ctx, app, getHandler } = createContext();
const { ctx, app, getHandler, resolveSessionKey } = createContext();
registerSlackInteractionEvents({ ctx: ctx as never });
const handler = getHandler();
@@ -142,6 +142,10 @@ describe("registerSlackInteractionEvents", () => {
channelId: "C1",
messageTs: "100.200",
});
expect(resolveSessionKey).toHaveBeenCalledWith({
channelId: "C1",
channelType: undefined,
});
expect(app.client.chat.update).toHaveBeenCalledTimes(1);
});

View File

@@ -253,7 +253,7 @@ export function registerSlackInteractionEvents(params: { ctx: SlackMonitorContex
// Pass undefined (not "unknown") to allow proper main session fallback
const sessionKey = ctx.resolveSlackSystemEventSessionKey({
channelId: channelId,
channelType: "channel",
channelType: undefined,
});
// Build context key - only include defined values to avoid "unknown" noise