wechaty / puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
https://wechaty.js.org/docs/puppet-providers/padlocal
Apache License 2.0
642 stars 88 forks source link

The application will crash while sending pictures #5

Closed krapnikkk closed 3 years ago

krapnikkk commented 3 years ago

environment

code

bot.on("message", async (msg: Message) => {
                const contact = msg.from()
                let text = msg.text()
                if (contact) {
                    const id = await contact!.id
                    console.log(`contact: ${id} Text: ${text}`)
                    await contact!.say('hello');
                    const fileBox = FileBox.fromFile('E:/coding/react/spidey/spidey-express/images/electron.png');
                    if (fileBox) {
                        await contact!.say(fileBox)
                    }
                }
            })

details

No matter what the local image file,it will crash if the bot send image frequently or sometimes.

error message

[Mon Nov 09 2020 20:47:35] [WARN] socket on error: IOError: socket is read-write timeout ...... [Mon Nov 09 2020 20:49:35] [ERROR] (node:36936) UnhandledPromiseRejectionWarning: VError: [tid:eaf4f6b4] Fail to send socket to:"113.96.230.45:80", data:ab00003126271082e.......

log download link

krapnikkk commented 3 years ago

fixed