Fix false DM build failure

This commit is contained in:
2026-09-20 16:12:32 +08:00
parent ec42517c83
commit f6668f3482
3 changed files with 29 additions and 2 deletions
@@ -0,0 +1,27 @@
# 远程最近一次私信失败复核
- 时间:2026-09-20 16:11
- 主机:`10.1.1.101`
## 结果
远程最新 replay 任务不是抖音 SDK 的发送拒绝,而是本地包装代码记录的:
- 任务状态:`failed`
- 结果:`MESSAGE_BUILD_FAILED`
- 发送参数已使用当前规则,UID 冷却为 60 秒。
## 根因
上一版已切换到站内 `sendMessageManager.sendMessage(builder)`,但发送完成后仍额外检查 `builder.getMessage().sendFunc`。当前抖音 builder 构造出的消息对象不保证暴露 `sendFunc`;站内 manager 自己可以正常使用该消息完成发送,因此这个检查会把发送后的结果错误标成失败。
由于旧代码没有持久化 manager 返回值,不能从任务账本证明这一次远端消息是否已经实际送达;不能直接重试,避免重复私信。
## 修复与部署
- 仅保留 `builder.getMessage()` 是否存在的构造检查,移除错误的 `sendFunc` 检查。
- 离线 IM 测试改为覆盖没有 `sendFunc` 的真实 builder 形态。
- 测试:IM 2、账号 47、计划 7,通知/activity、编译、diff、LSP 均通过。
- Windows 原生重新构建并安装成功,安装/构建 `DouyinAccounts.exe` SHA-256
`7309A2C1688EDD4CA01581D9D348DC610827EAAF234027CE07E98AE193E4A1D4`
- 未对该任务自动补发;需用户确认消息是否实际到达后,再决定是否手动重下发。
+1 -1
View File
@@ -84,7 +84,7 @@ EXPRESSION = r"""
aweType: 700, type: 0, richTextInfos: [], text: p.text}));
const result = await sendManager.sendMessage(builder);
const message = builder.getMessage();
if (!message || typeof message.sendFunc !== 'function') fail('MESSAGE_BUILD_FAILED');
if (!message) fail('MESSAGE_BUILD_FAILED');
let checkInfo = {};
if (typeof result?.checkMsg === 'string' && result.checkMsg) {
try { checkInfo = JSON.parse(result.checkMsg); } catch (_) { /* fixed fields below */ }
+1 -1
View File
@@ -25,7 +25,7 @@ const sdk = {
assert.equal(p.conversation, conversation);
assert.equal(p.type, 7);
assert.deepEqual(JSON.parse(p.content), {aweType:700,type:0,richTextInfos:[],text:TEXT});
return {sendFunc:()=>{}, sender:'54321', content:p.content, type:7};
return {sender:'54321', content:p.content, type:7};
},
sendMessage: async ({message}) => {
sent++; message.serverId='42'; return {success:true,statusCode:0,checkCode:0};