wx2tg-puppet 6.0.16 → 6.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/VERSION +1 -1
- package/dist/index.js +23 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
| 仓库 | 维护分支 | 本次 Git 标签 | npm / Docker 版本 |
|
|
8
8
|
| --- | --- | --- | --- |
|
|
9
|
-
| wechat2tg | `v6` | `v6.0.
|
|
10
|
-
| wx2tg-puppet | `v6` | `v6.0.
|
|
9
|
+
| wechat2tg | `v6` | `v6.0.39` | 包版本 `6.0.39`;镜像 `finalpi/wechat2tg:v6.0.39` |
|
|
10
|
+
| wx2tg-puppet | `v6` | `v6.0.17` | npm 格式包 `wx2tg-puppet@6.0.17` |
|
|
11
11
|
| wx2tg-server(fk-zhang) | `v6`,继承 `875` | `v6.0.16` | 镜像 `finalpi/wx2tg-server:v6.0.16` |
|
|
12
12
|
|
|
13
|
-
**只维护 `v6` 分支,开发版和稳定版用 tag 区分,不建立 `v6-dev` 分支。** `v6.X.Y-dev.N` 为开发版,`v6.X.Y` 为稳定版;npm 不带前面的 `v
|
|
13
|
+
**只维护 `v6` 分支,开发版和稳定版用 tag 区分,不建立 `v6-dev` 分支。** `v6.X.Y-dev.N` 为开发版,`v6.X.Y` 为稳定版;npm 不带前面的 `v`。三个组件在 v6 大版本内独立发布,不要求补丁版本号相同;本次 server 保持 v6.0.16。Docker 的 `v6-dev` 指向开发版、`v6` 指向稳定版,开发构建不得覆盖稳定别名。历史 `3.x`、`875`、`v51.*`、裸 `v6` 标签保留,不移动。
|
|
14
14
|
|
|
15
15
|
根目录 `VERSION`、`package.json`、`package-lock.json` 必须一致;发布标签必须为 `v${VERSION}`。创建本地标签不代表已推送或已发布 npm。发布前执行:
|
|
16
16
|
|
|
@@ -25,6 +25,13 @@ npm pack
|
|
|
25
25
|
|
|
26
26
|
`wechat2tg` 可继续锁定同版本本地制品以保证构建可重现;若切换 registry 来源,必须重新生成 lockfile 并校验制品,不要手工伪造 integrity。
|
|
27
27
|
|
|
28
|
+
## v6.0.17:联系人初始化修复
|
|
29
|
+
|
|
30
|
+
- 修复初始化时异步详情查询未等待、未捕获,导致 `Contact detail response did not contain the requested contact` 等异常刷屏。
|
|
31
|
+
- 每页最多 4 个并发详情请求,等待本页完成后再翻页;单项失败不会中断其他联系人或群聊。
|
|
32
|
+
- 逐批记录成功 / 失败数量,不记录联系人 ID、接口原始数据或凭据。缺失详情仍明确计入失败,不伪造成功或删除缓存。
|
|
33
|
+
- 183 项测试通过;对应 Bot 修复已通过用户的临时部署验收。
|
|
34
|
+
|
|
28
35
|
## 消息接收
|
|
29
36
|
|
|
30
37
|
### polling(保持默认)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.0.
|
|
1
|
+
6.0.17
|
package/dist/index.js
CHANGED
|
@@ -342,14 +342,31 @@ class WxBot extends events_1.EventEmitter {
|
|
|
342
342
|
// 处理当前批次的联系人
|
|
343
343
|
if (data.Data && data.Data.ContactUsernameList) {
|
|
344
344
|
console.log(`获取到 ${data.Data.ContactUsernameList.length} 个联系人`);
|
|
345
|
-
data.Data.ContactUsernameList
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
345
|
+
const contacts = data.Data.ContactUsernameList;
|
|
346
|
+
let nextIndex = 0;
|
|
347
|
+
let succeeded = 0;
|
|
348
|
+
let failed = 0;
|
|
349
|
+
// Bound detail requests and finish this page before requesting the next.
|
|
350
|
+
const worker = () => __awaiter(this, void 0, void 0, function* () {
|
|
351
|
+
while (nextIndex < contacts.length) {
|
|
352
|
+
const contact = contacts[nextIndex++];
|
|
353
|
+
try {
|
|
354
|
+
if (!contact.endsWith('@chatroom')) {
|
|
355
|
+
yield Contact_1.Contact.fetchAndUpsertContactDetail(userName, contact);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
yield Room_1.Room.find({ id: contact });
|
|
359
|
+
}
|
|
360
|
+
succeeded++;
|
|
361
|
+
}
|
|
362
|
+
catch (_a) {
|
|
363
|
+
// A missing/failed item must not abort the page or leak private data.
|
|
364
|
+
failed++;
|
|
365
|
+
}
|
|
351
366
|
}
|
|
352
367
|
});
|
|
368
|
+
yield Promise.all(Array.from({ length: Math.min(4, contacts.length) }, () => worker()));
|
|
369
|
+
console.log(`联系人批次处理完成: 成功 ${succeeded},失败 ${failed}`);
|
|
353
370
|
}
|
|
354
371
|
// 检查是否还有更多联系人需要获取
|
|
355
372
|
// CountinueFlag 为 1 表示还有更多数据
|