Open
Description
From above code, we can see that only uuid, url and qrcode fileboxes can call toJson method. However here:
puppet-service/src/file-box-helper/normalize-filebox.ts
Lines 30 to 80 in 5805a31
We can see that buffer and base64 fileboxes which are less than 20K size will pass. And this will result in error:
18:29:00 ERR PuppetServiceImpl grpcError() roomAvatar() rejection: FileBox.toJSON() can only work on limited FileBoxType(s). See: <https://github.com/huan/file-box/issues/25>
Error: FileBox.toJSON() can only work on limited FileBoxType(s). See: <https://github.com/huan/file-box/issues/25>
at FileBox.toJSON (C:\juzi\node_modules\file-box\dist\cjs\src\file-box.js:557:23)
at JSON.stringify (<anonymous>)
at serializeFileBox (C:\juzi\node_modules\wechaty-puppet-service\dist\cjs\src\server\puppet-implementation.js:70:21)
at async roomAvatar (C:\juzi\node_modules\wechaty-puppet-service\dist\cjs\src\server\puppet-implementation.js:882:43)