Monday, January 1, 2024
1 change · 17.0
Resolved issues and error corrections
This fix resolves an issue where forwarding messages through WhatsApp would fail with an error and prevent the message from being sent. The problem occurred because the system was incorrectly processing multiple message references. The update adds a validation check to ensure message IDs are properly present before processing, allowing forwarded messages to send successfully.
Original PR description
When the user sends a forwarded message to the WhatsApp business account a log error occurs and the forwarded message will not be sent to the WhatsApp business account Error:-"ValueError: Expected singleton: mail.message(195, 193, 192)" This is because at line [1], we receive multiple parent IDs WhatsApp messages because the value of "context.get()" is set to false. As a result, at [1], it searches for WhatsApp messages whose "msg.ids" is false, indicating that the messages in the queue have likely failed. This commit fixes the above issue by adding the condition that checks the ID is present in the context of the message. https://github.com/odoo/enterprise/blob/272856993b21d9e7edfb573e33a368f80ba0c9c8/whatsapp/models/whatsapp_account.py#L185 sentry-4745952077