Skip to content

Message send from WhatsApp to frappe whatsapp is not rendering in the chat UI #110

@Abilash-Ravichandran

Description

@Abilash-Ravichandran

Issue:

I am trying to integrate frappe_whatsapp with Frappe CRM, which I have running on Windows using Docker. When I send a message from Frappe CRM to WhatsApp, the message is sent successfully and displayed in the UI. However, when a user sends a message to the Frappe-integrated WhatsApp number, I only receive a notification about the message, but it is not displayed in the chat interface.

Additional observations:

  • The message sent from Frappe CRM to WhatsApp is received successfully in WhatsApp.
  • When a message is sent from a mobile phone to the Frappe-integrated WhatsApp number, I observe the following log in the console:

Error:

2024-11-20 12:17:03 06:47:03 web.1      | Traceback (most recent call last):
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/app.py", line 118, in application
2024-11-20 12:17:03 06:47:03 web.1      |     response = frappe.api.handle(request)
2024-11-20 12:17:03 06:47:03 web.1      |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/api/__init__.py", line 49, in handle
2024-11-20 12:17:03 06:47:03 web.1      |     data = endpoint(**arguments)
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
2024-11-20 12:17:03 06:47:03 web.1      |     return frappe.handler.handle()
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^^^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/handler.py", line 49, in handle
2024-11-20 12:17:03 06:47:03 web.1      |     data = execute_cmd(cmd)
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
2024-11-20 12:17:03 06:47:03 web.1      |     return frappe.call(method, **frappe.form_dict)
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/__init__.py", line 1807, in call
2024-11-20 12:17:03 06:47:03 web.1      |     return fn(*args, **newargs)
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
2024-11-20 12:17:03 06:47:03 web.1      |     return func(*args, **kwargs)
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^^^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe_whatsapp/frappe_whatsapp/utils/webhook.py", line 15, in webhook
2024-11-20 12:17:03 06:47:03 web.1      |     return post()
2024-11-20 12:17:03 06:47:03 web.1      |            ^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      |   File "apps/frappe_whatsapp/frappe_whatsapp/utils/webhook.py", line 149, in post
2024-11-20 12:17:03 06:47:03 web.1      |     "message": message[message_type].get(message_type),
2024-11-20 12:17:03 06:47:03 web.1      |                ~~~~~~~^^^^^^^^^^^^^^
2024-11-20 12:17:03 06:47:03 web.1      | KeyError: 'unsupported'
2024-11-20 12:17:03 06:47:03 web.1      | 
2024-11-20 12:17:03 06:47:03 web.1      | 172.18.0.1 - - [20/Nov/2024 06:47:03] "POST /api/method/frappe_whatsapp.utils.webhook.webhook HTTP/1.1" 500 -```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions