Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get into trouble with contact_avatar grpc method #19

Open
wj-Mcat opened this issue Jun 23, 2020 · 4 comments
Open

get into trouble with contact_avatar grpc method #19

wj-Mcat opened this issue Jun 23, 2020 · 4 comments

Comments

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented Jun 23, 2020

When we call method from chatie-grpc:

response = await self.puppet_stub.contact_avatar(id=contact_id)

we will receive error :

2020-06-23 19:51:17,895 - Wechaty - ERROR - internal error <(<Status.INTERNAL: 13>, 'FileBox.toJSON() can only work on limited FileBoxType(s). See: <https://github.com/huan/file-box/issues/25>', None)>
ERROR:Wechaty:internal error <(<Status.INTERNAL: 13>, 'FileBox.toJSON() can only work on limited FileBoxType(s). See: <https://github.com/huan/file-box/issues/25>', None)>

It seems that this error is from hostie-server. @huan

@huan
Copy link
Member

huan commented Jun 23, 2020

Yes, you are right.

This means that the FileBox in the server is not one of the following three types:

  1. FileBoxType.Base64
  2. FileBoxType.Url
  3. FileBoxType.QRCode

See: huan/file-box#25

What puppet are you using when you get this error message?

@wj-Mcat
Copy link
Collaborator Author

wj-Mcat commented Jun 23, 2020

The running puppet is under donut_token, which is using python-wechaty-puppet-hostie.

I test the room_avatar which run well for me, and the result type of response is FileBoxType.Url.

https://github.com/wechaty/python-wechaty-puppet-hostie/blob/f9ee69a861c337cbd1bb7c06199e24c3cd8beb29/src/wechaty_puppet_hostie/puppet.py#L819-L838

@wj-Mcat
Copy link
Collaborator Author

wj-Mcat commented Jun 24, 2020

It seems that room_avatar and contact_avatar should have the same FileBoxType, but depended on the
weixin machinism.

@huan
Copy link
Member

huan commented Jun 24, 2020

I think we should support the following three types in our Python FileBox first:

  1. FileBoxType.Base64
  2. FileBoxType.Url
  3. FileBoxType.QRCode

I'll have a check on the wechaty-puppet-hostie later.

To explain what we need to do with the wechaty-puppet-hostie: we need to make sure that the FileBox of room_avatar and the contact_avatar must be one of the above three types.

If not, convert it before we use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants