Skip to content

Commit 86321dc

Browse files
committed
fix(feishu): scope topic hydration id for errors
1 parent 3a6a7de commit 86321dc

2 files changed

Lines changed: 25 additions & 27 deletions

File tree

‎extensions/feishu/src/bot.test.ts‎

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,30 +2837,28 @@ describe("handleFeishuMessage command authorization", () => {
28372837
expectResolvedRouteCall(1, { kind: "group", id: "oc-group:topic:omt_native_topic" });
28382838
});
28392839

2840-
it.each(
2841-
[
2842-
{
2843-
action: "created",
2844-
scope: "group_topic",
2845-
expectedPeerId: "oc-group:topic:omt_native_reaction",
2846-
},
2847-
{
2848-
action: "deleted",
2849-
scope: "group_topic",
2850-
expectedPeerId: "oc-group:topic:omt_native_reaction",
2851-
},
2852-
{
2853-
action: "created",
2854-
scope: "group_topic_sender",
2855-
expectedPeerId: "oc-group:topic:omt_native_reaction:sender:ou-reaction-actor",
2856-
},
2857-
{
2858-
action: "deleted",
2859-
scope: "group_topic_sender",
2860-
expectedPeerId: "oc-group:topic:omt_native_reaction:sender:ou-reaction-actor",
2861-
},
2862-
] as const,
2863-
)(
2840+
it.each([
2841+
{
2842+
action: "created",
2843+
scope: "group_topic",
2844+
expectedPeerId: "oc-group:topic:omt_native_reaction",
2845+
},
2846+
{
2847+
action: "deleted",
2848+
scope: "group_topic",
2849+
expectedPeerId: "oc-group:topic:omt_native_reaction",
2850+
},
2851+
{
2852+
action: "created",
2853+
scope: "group_topic_sender",
2854+
expectedPeerId: "oc-group:topic:omt_native_reaction:sender:ou-reaction-actor",
2855+
},
2856+
{
2857+
action: "deleted",
2858+
scope: "group_topic_sender",
2859+
expectedPeerId: "oc-group:topic:omt_native_reaction:sender:ou-reaction-actor",
2860+
},
2861+
] as const)(
28642862
"hydrates topic threads from the real message ID for synthetic $action reactions in $scope sessions",
28652863
async ({ action, scope, expectedPeerId }) => {
28662864
mockShouldComputeCommandAuthorized.mockReturnValue(false);

‎extensions/feishu/src/bot.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,10 @@ export async function handleFeishuMessage(params: {
517517
!effectiveThreadId &&
518518
isFeishuTopicSessionScope(groupSessionScope ?? "group")
519519
) {
520+
// Synthetic turns keep a local dedupe ID in messageId; their explicit reply target is
521+
// the real Feishu message ID that topic hydration can send back to the provider.
522+
const topicHydrationMessageId = ctx.replyTargetMessageId ?? ctx.messageId;
520523
try {
521-
// Synthetic turns keep a local dedupe ID in messageId; their explicit reply target is
522-
// the real Feishu message ID that topic hydration can send back to the provider.
523-
const topicHydrationMessageId = ctx.replyTargetMessageId ?? ctx.messageId;
524524
const messageInfo = await getMessageFeishu({
525525
cfg,
526526
accountId: account.accountId,

0 commit comments

Comments
 (0)