aldinokemal / go-whatsapp-web-multidevice

API for Whatsapp Web Multi Device Version, Support UI & Webhook
MIT License
582 stars 245 forks source link

Bug when receiving audio🐞 #166

Closed TheProcedural closed 4 months ago

TheProcedural commented 4 months ago

What happened?

When receiving audio the app fails and the audio is never received (sending audio works just fine).

The problem seems to be related to this other issue 157. But I don't see an answer and it's already closed. Note that for me it only happens with audio.

Reproduction Steps

1) Deploy project using docker image
2) Try to receive an audio

Relevant log output

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 
 β”‚                   Fiber v2.52.4                   β”‚ 
 β”‚               http://127.0.0.1:3000               β”‚ 
 β”‚       (bound on host 0.0.0.0 and port 3000)       β”‚ 
 β”‚                                                   β”‚ 
 β”‚ Handlers ............ 43  Processes ........... 1 β”‚ 
 β”‚ Prefork ....... Disabled  PID ................. 1 β”‚ 
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 

time="2024-07-10T11:15:26Z" level=info msg="Forwarding event to webhook:https://webhook.site/d41b5867-b9d0-4496-a3ce-a2a25ea5e96d"
11:15:26.524 [Client ERROR] Event handler panicked while handling a *events.Message: runtime error: index out of range [0] with length 0
goroutine 68 [running]:
runtime/debug.Stack()
    /usr/local/go/src/runtime/debug/stack.go:24 +0x64
go.mau.fi/whatsmeow.(*Client).dispatchEvent.func1()
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/client.go:758 +0x98
panic({0xd8dfe0?, 0x400049a210?})
    /usr/local/go/src/runtime/panic.go:914 +0x218
github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/whatsapp.ExtractMedia({0xe03d00, 0xd}, {0xf50f38, 0x400035ef00?})
    /whatsapp/pkg/whatsapp/whatsapp.go:462 +0x45c
github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/whatsapp.forwardToWebhook(0x400019f8c0)
    /whatsapp/pkg/whatsapp/whatsapp.go:380 +0xd4c
github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/whatsapp.handler({0xcbe000?, 0x400019f8c0?})
    /whatsapp/pkg/whatsapp/whatsapp.go:260 +0x1614
go.mau.fi/whatsmeow.(*Client).dispatchEvent(0x400019f8c0?, {0xcbe000?, 0x400019f8c0})
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/client.go:762 +0xf0
go.mau.fi/whatsmeow.(*Client).handleDecryptedMessage(0x4000170000?, 0x40003cdd40, 0x40001a0280, 0x0)
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/message.go:576 +0xcc
go.mau.fi/whatsmeow.(*Client).decryptMessages(0x40003f8000, 0x40003cdd40, 0x40000ba9f0)
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/message.go:231 +0xa08
go.mau.fi/whatsmeow.(*Client).handleEncryptedMessage(0x40003f8000, 0x40000ba9f0)
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/message.go:51 +0x31c
go.mau.fi/whatsmeow.(*Client).handlerQueueLoop.func1()
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/client.go:709 +0x84
created by go.mau.fi/whatsmeow.(*Client).handlerQueueLoop in goroutine 67
    /go/pkg/mod/go.mau.fi/whatsmeow@v0.0.0-20240619210240-329c2336a6f1/client.go:707 +0x148

Screenshots or Additional Context

image

Application Version

4.14.1

Verification

aldinokemal commented 4 months ago

duplicate https://github.com/aldinokemal/go-whatsapp-web-multidevice/discussions/162