When receiving an incoming WhatsApp message via frappe_whatsapp webhook, a CRM Notification is created automatically.
If no user is assigned (agent is None), the system throws a MandatoryError because to_user is required.
This causes the webhook request to fail even though the WhatsApp message is successfully received
Error
frappe.exceptions.MandatoryError:
[CRM Notification]: to_user
Behavior
- Webhook crashes when
to_user is None
Notes
- Happens for incoming WhatsApp messages
- Triggered from
crm/api/whatsapp.py → notify_agent → notify_user
assigned_users can be [None]