mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 02:32:44 +00:00
fix(telegram): make reaction handling soft-fail and message-id resilient (#20236)
* Telegram: soft-fail reactions and fallback to inbound message id * Telegram: soft-fail missing reaction message id * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -14,7 +14,12 @@ describe("channels dock", () => {
|
||||
|
||||
const telegramContext = telegramDock?.threading?.buildToolContext?.({
|
||||
cfg: emptyConfig(),
|
||||
context: { To: " room-1 ", MessageThreadId: 42, ReplyToId: "fallback" },
|
||||
context: {
|
||||
To: " room-1 ",
|
||||
MessageThreadId: 42,
|
||||
ReplyToId: "fallback",
|
||||
CurrentMessageId: "9001",
|
||||
},
|
||||
hasRepliedRef,
|
||||
});
|
||||
const googleChatContext = googleChatDock?.threading?.buildToolContext?.({
|
||||
@@ -26,6 +31,7 @@ describe("channels dock", () => {
|
||||
expect(telegramContext).toEqual({
|
||||
currentChannelId: "room-1",
|
||||
currentThreadTs: "42",
|
||||
currentMessageId: "9001",
|
||||
hasRepliedRef,
|
||||
});
|
||||
expect(googleChatContext).toEqual({
|
||||
@@ -35,6 +41,23 @@ describe("channels dock", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("telegram threading does not treat ReplyToId as thread id in DMs", () => {
|
||||
const hasRepliedRef = { value: false };
|
||||
const telegramDock = getChannelDock("telegram");
|
||||
const context = telegramDock?.threading?.buildToolContext?.({
|
||||
cfg: emptyConfig(),
|
||||
context: { To: " dm-1 ", ReplyToId: "12345", CurrentMessageId: "12345" },
|
||||
hasRepliedRef,
|
||||
});
|
||||
|
||||
expect(context).toEqual({
|
||||
currentChannelId: "dm-1",
|
||||
currentThreadTs: undefined,
|
||||
currentMessageId: "12345",
|
||||
hasRepliedRef,
|
||||
});
|
||||
});
|
||||
|
||||
it("irc resolveDefaultTo matches account id case-insensitively", () => {
|
||||
const ircDock = getChannelDock("irc");
|
||||
const cfg = {
|
||||
|
||||
Reference in New Issue
Block a user