From baedee094a056fe14d915cd972b96e735c864220 Mon Sep 17 00:00:00 2001 From: NickWang Date: Mon, 30 Oct 2023 12:00:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20dirty=20propagation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/schemas/wechaty-events.ts | 3 +++ src/wechaty-mixins/puppet-mixin.ts | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 43d1646ef..213fdb43e 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "@chatie/eslint-config": "^1.0.4", "@chatie/semver": "^0.4.7", "@chatie/tsconfig": "^4.6.3", - "@juzi/wechaty-puppet": "^1.0.66", + "@juzi/wechaty-puppet": "^1.0.68", "@juzi/wechaty-puppet-mock": "^1.0.1", "@swc/core": "1.3.44", "@swc/helpers": "^0.3.6", diff --git a/src/schemas/wechaty-events.ts b/src/schemas/wechaty-events.ts index 19b20009f..3711e4ab6 100644 --- a/src/schemas/wechaty-events.ts +++ b/src/schemas/wechaty-events.ts @@ -73,6 +73,7 @@ type WechatyEventListenerTagGroup = (type: PUPPET.types.TagGroupEvent, type WechatyEventListenerPostComment = (comment: PostInterface, post: PostInterface) => void | Promise type WechatyEventListenerPostTap = (post: PostInterface, contact: ContactInterface, type: PUPPET.types.Tap, tap: boolean, date?: Date) => void | Promise type WechatyEventListenerVerifyCode = (id: string, message: string, scene: PUPPET.types.VerifyCodeScene, status: PUPPET.types.VerifyCodeStatus) => void | Promise +type WechatyEventListenerDirty = (id: string, type: PUPPET.types.Dirty) => void | Promise /** * @desc Wechaty Class Event Type @@ -261,6 +262,7 @@ interface WechatyEventListeners { 'post-comment' : WechatyEventListenerPostComment 'post-tap' : WechatyEventListenerPostTap 'verify-code' : WechatyEventListenerVerifyCode + 'dirty' : WechatyEventListenerDirty } const WechatyEventEmitter = EventEmitter as any as new () => TypedEventEmitter< @@ -302,6 +304,7 @@ export type { WechatyEventListenerPostComment, WechatyEventListenerPostTap, WechatyEventListenerVerifyCode, + WechatyEventListenerDirty, } export { WechatyEventEmitter, diff --git a/src/wechaty-mixins/puppet-mixin.ts b/src/wechaty-mixins/puppet-mixin.ts index 2bab34348..0fea3274a 100644 --- a/src/wechaty-mixins/puppet-mixin.ts +++ b/src/wechaty-mixins/puppet-mixin.ts @@ -649,7 +649,7 @@ const puppetMixin = (oldPayload, newPayload) if (differences.length === 0) { log.info('WechatyPuppetMixin', `got dirty for contact ${payloadId} but cannot find any difference. old payload: ${JSON.stringify(oldPayload)}, new payload: ${JSON.stringify(newPayload)}`) - return + break } const importantDifferences = differences.filter(ele => ele && ContactImportantFields.some(key => key === ele.key)) @@ -721,7 +721,7 @@ const puppetMixin = ele && RoomImportantFields.some(key => key === ele.key)) @@ -778,6 +778,7 @@ const puppetMixin = Date: Mon, 30 Oct 2023 12:01:21 +0800 Subject: [PATCH 2/2] 1.0.75 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 213fdb43e..040f9c3e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@juzi/wechaty", - "version": "1.0.74", + "version": "1.0.75", "description": "Wechaty is a RPA SDK for Chatbot Makers.", "type": "module", "exports": {