mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 05:32:44 +00:00
Slack: infer interaction channel type from channel ID
This commit is contained in:
@@ -87,7 +87,7 @@ function createContext() {
|
|||||||
describe("registerSlackInteractionEvents", () => {
|
describe("registerSlackInteractionEvents", () => {
|
||||||
it("enqueues structured events and updates button rows", async () => {
|
it("enqueues structured events and updates button rows", async () => {
|
||||||
enqueueSystemEventMock.mockReset();
|
enqueueSystemEventMock.mockReset();
|
||||||
const { ctx, app, getHandler } = createContext();
|
const { ctx, app, getHandler, resolveSessionKey } = createContext();
|
||||||
registerSlackInteractionEvents({ ctx: ctx as never });
|
registerSlackInteractionEvents({ ctx: ctx as never });
|
||||||
|
|
||||||
const handler = getHandler();
|
const handler = getHandler();
|
||||||
@@ -142,6 +142,10 @@ describe("registerSlackInteractionEvents", () => {
|
|||||||
channelId: "C1",
|
channelId: "C1",
|
||||||
messageTs: "100.200",
|
messageTs: "100.200",
|
||||||
});
|
});
|
||||||
|
expect(resolveSessionKey).toHaveBeenCalledWith({
|
||||||
|
channelId: "C1",
|
||||||
|
channelType: undefined,
|
||||||
|
});
|
||||||
expect(app.client.chat.update).toHaveBeenCalledTimes(1);
|
expect(app.client.chat.update).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ export function registerSlackInteractionEvents(params: { ctx: SlackMonitorContex
|
|||||||
// Pass undefined (not "unknown") to allow proper main session fallback
|
// Pass undefined (not "unknown") to allow proper main session fallback
|
||||||
const sessionKey = ctx.resolveSlackSystemEventSessionKey({
|
const sessionKey = ctx.resolveSlackSystemEventSessionKey({
|
||||||
channelId: channelId,
|
channelId: channelId,
|
||||||
channelType: "channel",
|
channelType: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Build context key - only include defined values to avoid "unknown" noise
|
// Build context key - only include defined values to avoid "unknown" noise
|
||||||
|
|||||||
Reference in New Issue
Block a user