juzibot / donut-tester

40 stars 4 forks source link

UnhandledPromiseRejectionWarning: Wechaty Puppet Unsupported API Error on receiving ChatHistory #80

Closed suntong closed 3 years ago

suntong commented 3 years ago

Important:Please file the issue follow the template, or we won't help you to solve the problem.

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:
    rm -rf package-lock.json
    rm -rf node_modules
    npm install

No.

  1. Please search in FAQ List first, and make sure your problem has not been solved before.

  2. Please search in the issue first, and make sure your problem had not been reported before

1. Versions

2. Describe the bug

Give a clear and concise description of what the bug is.

When receiving messages of type ChatHistory, I'll get

(node:20356) UnhandledPromiseRejectionWarning: Error: 2 UNKNOWN: Wechaty Puppet Unsupported API Error. Learn More At https://github.com/wechaty/wechaty-puppet/wiki/Compatibility
    at Object.exports.createStatusError (/path/to/nodejs/node_modules/grpc/src/common.js:91:15)
    at ClientReadableStream._emitStatusIfDone (/path/to/nodejs/node_modules/grpc/src/client.js:233:26)
    at ClientReadableStream._receiveStatus (/path/to/nodejs/node_modules/grpc/src/client.js:211:8)
    at Object.onReceiveStatus (/path/to/nodejs/node_modules/grpc/src/client_interceptors.js:1277:15)
    at InterceptingListener._callNext (/path/to/nodejs/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/path/to/nodejs/node_modules/grpc/src/client_interceptors.js:618:8)
    at /path/to/nodejs/node_modules/grpc/src/client_interceptors.js:1033:24
(node:20356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

3. To Reproduce

This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.

Steps to reproduce the behavior:

Receive ChatHistory.

4. Expected behavior

ChatHistory supported, or at least passing the payload to the user, instead of throwing exception.

5. Actual behavior

ChatHistory unsupported and cause the above exception.

6. Full Output Logs

Will be provided, if necessary.

[bug]