fix(slack): enforce replyToMode for auto-thread_ts and inline reply tags (#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
This commit is contained in:
Vincent Koc
2026-02-22 14:36:46 -05:00
committed by GitHub
parent 9f7c1686b4
commit 71c2c59c6c
6 changed files with 62 additions and 17 deletions

View File

@@ -45,6 +45,38 @@ describe("resolveSlackThreadTargets", () => {
expect(statusThreadTs).toBeUndefined();
});
it("does not treat auto-created top-level thread_ts as a real thread when mode is off", () => {
const { replyThreadTs, statusThreadTs, isThreadReply } = resolveSlackThreadTargets({
replyToMode: "off",
message: {
type: "message",
channel: "C1",
ts: "123",
thread_ts: "123",
},
});
expect(isThreadReply).toBe(false);
expect(replyThreadTs).toBeUndefined();
expect(statusThreadTs).toBeUndefined();
});
it("keeps first-mode behavior for auto-created top-level thread_ts", () => {
const { replyThreadTs, statusThreadTs, isThreadReply } = resolveSlackThreadTargets({
replyToMode: "first",
message: {
type: "message",
channel: "C1",
ts: "123",
thread_ts: "123",
},
});
expect(isThreadReply).toBe(false);
expect(replyThreadTs).toBeUndefined();
expect(statusThreadTs).toBeUndefined();
});
it("sets messageThreadId for top-level messages when replyToMode is all", () => {
const context = resolveSlackThreadContext({
replyToMode: "all",