Skip to content
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

Issues with WhatsApp Integration on Custom Frappe App #111

Open
alliance-techfunctionals opened this issue Nov 29, 2024 · 0 comments
Open

Comments

@alliance-techfunctionals

Description:
I am using the paid versions of Frappe WhatsApp and WhatsApp Chat in my custom Frappe application. However, I am encountering the following issues:

  1. When I attempt to start a chat using the WhatsApp chat dialog box, it creates a new chat room but does not display the chat in the dialog box after creation.
  2. Incoming messages are not appearing in the WhatsApp Message Doctype after I installed the WhatsApp Chat feature on my website.

Could you please help me resolve these issues?

Thank you!

Error screenshots and text:
image

App Versions

{
	"frappe": "15.48.1",
	"frappe_repro": "0.0.1",
	"frappe_whatsapp": "1.0.7",
	"whatsapp_chat": "0.0.1"
}

Route

Workspaces/Users

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1725, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/whatsapp_chat/whatsapp_chat/api/message.py", line 14, in get_all
    return frappe.db.sql("""
           ^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 229, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.11/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.11/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'"tabWhatsApp Message" where "to" = \'6397880363\' or "from" = \'6397880363\'\n    ...\' at line 11')

Request Data

{
	"type": "POST",
	"args": {
		"room": "bohv9faat0",
		"user_no": "6397880363"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/whatsapp_chat.api.message.get_all",
	"request_id": "32f5362a-8b5c-4c05-9020-cfcf59b8f3ac"
}

Response Data

{
	"exception": "pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \\'\"tabWhatsApp Message\" where \"to\" = \\'6397880363\\' or \"from\" = \\'6397880363\\'\\n    ...\\' at line 11')",
	"exc_type": "ProgrammingError",
	"_exc_source": "whatsapp_chat (app)",
	"_debug_messages": "[\"Syntax error in query:\\nSELECT creation,\\n        case\\n            when \\\"to\\\" <> '' then \\\"to\\\"\\n            else\\n            'Administrator'\\n        end as sender_user_no,\\n        case\\n            when content_type = 'text' then message\\n            else attach\\n        end as content\\n        from \\\"tabWhatsApp Message\\\" where \\\"to\\\" = %(user_no)s or \\\"from\\\" = %(user_no)s\\n        order by creation asc /* FRAPPE_TRACE_ID: 32f5362a-8b5c-4c05-9020-cfcf59b8f3ac */ {'user_no': '6397880363'}\"]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant