Closed huan closed 2 years ago
Thank you for describing this bug, it help me to resolve it quickly. It could be resolved after 1.15.1
.
You are welcome.
I'm curious about why the typing system (TypeScript) has not prevented this bug, and how could this happen after we have finished testing the v0.41?
Somehow xiaoju-bot and puppet-whatsapp@0.41 works. Will check corresponding code.
Please let me know when we have any updates, thank you very much!
I think this bug was produced when we tried to single out event handlers and simply copied v0.41 code. Although we did run ding-dong-bot a lot, we used memory-card to avoid repeated login and logout so we missed this. in v0.40s of wechaty, scan event is like (qrcode: string, status: ScanStatus)
I'm curious about why the typing system (TypeScript) has not prevented this bug, and how could this happen after we have finished testing the v0.41?
{
status: {
status: 2,
},
}
Maybe it seems that typescript regard this data as PUPPET.payloads.EventScan?
Somehow xiaoju-bot and puppet-whatsapp@0.41 works. Will check corresponding code.
It works due to the puppet-whatsapp
version is 0.41.198
, and the version does not contain the refactor code(something wrong when refactor).
Thanks for the investigation!
I think there might need an integration test to make sure we can receive the scan
event from the puppet after it start()-ed.
Close this issue because the problem has been fixed.
Appreciate it!
I'm writing a test for qrcode, hoping it will prevent this kind of situation in the future. #333
It seems that we are emitting the
scan
event payload incorrectly:https://github.com/wechaty/puppet-whatsapp/blob/bdfa32ea8e2ab4c7be01c0ed90e1c33b87597025/src/whatsapp/event-handler/login-event-handler.ts#L36-L40
According to the above code, the typing of the payload is
status: PUPPET.payloads.EventScan, url?: string | undefined
but we providedqr
.Which I believe is the reason that I got the below log messages:
And according to the below code:
https://github.com/wechaty/puppet-whatsapp/blob/bdfa32ea8e2ab4c7be01c0ed90e1c33b87597025/src/puppet-whatsapp.ts#L175-L180
We can confirm that the
status
andqrcode
from'onScan(%s, %s)', status, qrcode
are both incorrect.@su-chang @hcfw007