fix(hooks): fail open without thread ownership routing · openclaw/openclaw@7d088f1
vincentkoc
·
2026-04-23
·
via Recent Commits to openclaw:main
File tree
extensions/thread-ownership
| Original file line number | Diff line number | Diff line change |
|---|
@@ -71,6 +71,16 @@ describe("thread-ownership plugin", () => {
|
71 | 71 | expect(globalThis.fetch).not.toHaveBeenCalled(); |
72 | 72 | }); |
73 | 73 | |
| 74 | +it("fails open when Slack thread routing has no canonical conversation id", async () => { |
| 75 | +const result = await hooks.message_sending( |
| 76 | +{ content: "hello", replyToId: "1234.5678", metadata: {}, to: "" }, |
| 77 | +{ channelId: "slack", conversationId: "" }, |
| 78 | +); |
| 79 | + |
| 80 | +expect(result).toBeUndefined(); |
| 81 | +expect(globalThis.fetch).not.toHaveBeenCalled(); |
| 82 | +}); |
| 83 | + |
74 | 84 | it("claims ownership successfully", async () => { |
75 | 85 | vi.mocked(globalThis.fetch).mockResolvedValue( |
76 | 86 | new Response(JSON.stringify({ owner: "test-agent" }), { status: 200 }), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -112,7 +112,7 @@ export default definePluginEntry({
|
112 | 112 | normalizeOptionalString(event.metadata?.channelId) || |
113 | 113 | normalizeOptionalString(event.to) || |
114 | 114 | ""; |
115 | | -if (!threadTs) { |
| 115 | +if (!threadTs || !channelId) { |
116 | 116 | return undefined; |
117 | 117 | } |
118 | 118 | if (abTestChannels.size > 0 && !abTestChannels.has(channelId)) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。