You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we uprade to wechaty 1.x, we found that there are many errors in server-side like this:
01:20:04 ERR PuppetServiceImpl grpcError() contactPayload() rejection: ERR_INVALID_CONTACT_ID all ids should be number, R:10904522578147112 is not a number.
Error: ERR_INVALID_CONTACT_ID all ids should be number, R:10904522578147112 is not a number.
We can see that roomMemberPayloadDirty uses a room id as parameter.
This is very confusing. After a discussion with @su-chang , we decided to use contact id. Because roomMember is a contact. So we came up with this PR: #6
It will dirty all room members when room syncs and that solves the problem of ERR_INVALID_CONTACT_ID. However this causes abundant dirty calls so we addpatch for that in #10.
When we uprade to wechaty 1.x, we found that there are many errors in server-side like this:
ref: https://github.com/juzibot/wechaty-puppet-wxwork/issues/720
That is cuased by these code:
https://github.com/wechaty/wechaty/blob/fd31dffaf2af0cce2d3ad7e57ae47a50e1b41aa1/src/wechaty-mixins/puppet-mixin.ts#L436-L449
We can see that when receiving a roomMemberDirty event, the payload will be handled as a contact id, and we try to load the contact with that id.
However when reading this code:
https://github.com/wechaty/wechaty/blob/fd31dffaf2af0cce2d3ad7e57ae47a50e1b41aa1/src/wechaty-mixins/puppet-mixin.ts#L388-L391
https://github.com/wechaty/wechaty/blob/fd31dffaf2af0cce2d3ad7e57ae47a50e1b41aa1/src/user-modules/room.ts#L300-L304
We can see that roomMemberPayloadDirty uses a room id as parameter.
This is very confusing. After a discussion with @su-chang , we decided to use contact id. Because roomMember is a contact. So we came up with this PR:
#6
It will dirty all room members when room syncs and that solves the problem of ERR_INVALID_CONTACT_ID. However this causes abundant dirty calls so we addpatch for that in #10.
However when we read the code in wechaty-puppet-wxwork, https://github.com/juzibot/wechaty-puppet-wxwork/blob/6b9b737f823104e7809a131baceb27e798a75ae3/src/puppet-work.ts#L801-L803, we noticed that roomMemberPayload should accept a room id at the very begining. And this will natually solves the problem of abundant dirty calls. So the thing we are gonna do is:
The text was updated successfully, but these errors were encountered: