@vrs-soft/wecom-aibot-mcp 2.3.0 → 2.3.1
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/dist/client.js +4 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -547,9 +547,12 @@ class WecomClient extends EventEmitter {
|
|
|
547
547
|
// 清理过期消息
|
|
548
548
|
cleanupMessages(maxAgeMs = 300000) {
|
|
549
549
|
const cutoff = Date.now() - maxAgeMs;
|
|
550
|
+
// 未解决的审批保留 15 分钟,防止用户在超时前点击时记录已被清理导致按钮失效
|
|
551
|
+
const pendingCutoff = Date.now() - 15 * 60 * 1000;
|
|
550
552
|
this.messages = this.messages.filter(m => m.timestamp > cutoff);
|
|
551
553
|
this.approvals.forEach((a, k) => {
|
|
552
|
-
|
|
554
|
+
const threshold = a.resolved ? cutoff : pendingCutoff;
|
|
555
|
+
if (a.timestamp < threshold)
|
|
553
556
|
this.approvals.delete(k);
|
|
554
557
|
});
|
|
555
558
|
// 清理过期的待发送消息
|