Skip to content

Commit 7692637

Browse files
schumilinclaude
andcommitted
fix(feishu): normalize target IDs with parseFeishuDirectConversationId
Use the same Feishu ID parser for target recipient matching as for approver normalization, so all address forms (dm:ou_xxx, open_id:ou_xxx, feishu:user:ou_xxx) are handled consistently. (Codex P2) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent d42a6e5 commit 7692637

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

extensions/feishu/src/exec-approvals.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,14 @@ export function isFeishuExecApprovalTargetRecipient(params: {
7070
...params,
7171
channel: "feishu",
7272
matchTarget: ({ target, normalizedSenderId }) => {
73-
const to = target.to?.trim();
74-
if (!to) {
73+
// Use the same parser as approver normalization to handle all
74+
// Feishu address forms (user:ou_xxx, dm:ou_xxx, open_id:ou_xxx,
75+
// feishu:user:ou_xxx, bare ou_xxx).
76+
const parsed = parseFeishuDirectConversationId(target.to);
77+
if (!parsed) {
7578
return false;
7679
}
77-
// Strip "user:" prefix for DM targets
78-
const normalized = to.startsWith("user:") ? to.slice(5) : to;
79-
return normalized === normalizedSenderId;
80+
return parsed === normalizedSenderId;
8081
},
8182
});
8283
}

0 commit comments

Comments
 (0)