-
Notifications
You must be signed in to change notification settings - Fork 5.1k
fix: convert mediaKey from media messages to avoid bad decrypt errors #1948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: convert mediaKey from media messages to avoid bad decrypt errors #1948
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsure mediaKey passed to Baileys download functions is converted from an object to a Uint8Array, preventing bad decrypt errors when using downloadMediaMessage or downloadContentFromMessage. Sequence diagram for mediaKey conversion before media downloadsequenceDiagram
participant Service as BaileysStartupService
participant MediaMsg as mediaMessage
participant Baileys as Baileys download function
Service->>MediaMsg: Check mediaKey type
alt mediaKey is object
Service->>MediaMsg: Convert mediaKey to Uint8Array
end
Service->>Baileys: Call downloadMediaMessage/downloadContentFromMessage with converted mediaKey
Class diagram for mediaKey handling in BaileysStartupServiceclassDiagram
class BaileysStartupService {
+downloadMediaMessage(msg)
+downloadContentFromMessage(msg)
}
class mediaMessage {
mediaKey: object | Uint8Array
}
BaileysStartupService --|> mediaMessage: uses
BaileysStartupService : converts mediaKey from object to Uint8Array
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Boa. Apliquei aqui. Entrei 100 mil mensagens tenho umas 10 dessas por dia. Irei acompanhar aqui e amanha darei um retorno. |
Calling baileys downloadMediaMessage or downloadContentFromMessage with parameter "mediaKey" with an object will fail.
Summary by Sourcery
Bug Fixes: