mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.04k stars 795 forks source link

Web WhatsApp Update: Many JS errors #1152

Open efjcz opened 2 years ago

efjcz commented 2 years ago

Hello community

I am using a selenium-hub system to work with whatsapp in one dedicated container and a lot of other resources as well in other containers.

A while ago the web interface showed an orange message saying we should update web interface or it would auto-update in X days. And now the time has come.

After update I tried to keep using firefox 3.141.59, but I got many exceptions on some basic tasks, like send message on chats. I didn't explore yet which features has been impacted. See some logs below:

Traceback (most recent call last):
...
File "webwhatsapi/wapi_js_wrapper.py", line 80, in _dir_
  result = self.driver.execute_script(
            "if (document.querySelector('*[data-icon=chat]') !== null) { return true } else { return false }"
             )  # noqa E501

I tried to change to chrome, but I couldn't make it work in Remote option, since I am using docker

Then I tried to use the version recommended by the author, 3.14-curium. And just after read the QR Code, the firefox re-open the QR Code page and ask to try it again because whatsapp could't sync the database with the browser.

Then I tried to use selenium/node-firefox-debug:3.141.59-20200730 and the browser crashes just after read the QR Code, and I see these logs below:

firefox1      | JavaScript error: https://web.whatsapp.com/serviceworker.js, line 1: TypeError: Cache.put: Cache got basic response with bad status 206 while trying to add request https://web.whatsapp.com/sequential-ptt-middle_7fa161964e93db72b8d00ae22189d75f.mp3
firefox1      | JavaScript error: https://web.whatsapp.com/serviceworker.js, line 1: TypeError: Cache.put: Cache got basic response with bad status 206 while trying to add request https://web.whatsapp.com/sequential-ptt-end_62ed28be622237546fd39f9468a76a49.mp3
firefox1      | JavaScript error: https://web.whatsapp.com/serviceworker.js, line 1: TypeError: Cache.put: Cache got basic response with bad status 206 while trying to add request https://web.whatsapp.com/notification_2a485d84012c106acef03b527bb54635.mp3
firefox1      | A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
firefox1      | 1654395622092   Marionette  ERROR   [5] No reply from Marionette:Register
firefox1      | 1654395622173   Marionette  INFO    Stopped listening on port 43607

Is anyone else facing any kind of issues? Any idea or solution yet? I will keep trying other versions and try to find any clue with more logs.

3dluis commented 2 years ago

WAPI.getChat VM308:567 Uncaught TypeError: Cannot read properties of undefined (reading '_serialized') at window.WAPI.getChat (:567:42) at window.WAPI.loadAllEarlierMessages (:800:24) at window.WAPI.asyncLoadAllEarlierMessages (:813:17) at :1:6

3dluis commented 2 years ago

VM1047:827 Uncaught TypeError: found.loadEarlierMsgs is not a function at x (:827:19) at window.WAPI.loadAllEarlierMessages (:832:5) at window.WAPI.asyncLoadAllEarlierMessages (:837:17) at :857:14 at Array.forEach () at window.WAPI.loadAllChatEarlierMessages (:856:11) at :1:6

andlb commented 2 years ago

Hi, Could you replace firefox by chrome? I have the same issue and it was fixed after I replace for chrome See #1144

frnkvieira commented 2 years ago

Same "found.loadEarlierMsgs is not a function" error here. (Chrome)