tomer8007 / whatsapp-web-incognito

A Chrome extension that disables read receipts and presence updates on WhatsApp Web
MIT License
324 stars 75 forks source link

Show Device of Messages stopped working #145

Closed JMWAH666 closed 1 year ago

JMWAH666 commented 1 year ago

Show Device of Messages stopped working

Recently, this feature seems to have stopped functioning. I no longer get any information if the messages I receive were sent by a phone or computer. I wanted to know if this has been disabled, and if not, is there something I should do to get it to work again.

I uninstalled and reinstalled the extension – no change I unlinked and relinked WhatsApp web – no change I turned off and restarted computer – no change I cleared cache, cookies and history – no change

Any guidance/assistance would be appreciated.

Device: HP Win 10 laptop

tomer8007 commented 1 year ago

Hi, I just tested this feature and it works for me. Can you open the javascript console (F12) and see if there any errors while you get messages?

tomer8007 commented 1 year ago

Also what WhatsApp version are you using?

JMWAH666 commented 1 year ago

WhatsApp version is Web Version 2.2340.9 I am trying to scroll through JavaScript and save the file to send to you. Give me a few minutes Thanks again

JMWAH666 commented 1 year ago

If I send myself a WhatsApp message from my phone, would that generate the JavaScript you’re looking for?

tomer8007 commented 1 year ago

You just have to open the javascript console by pressing F12 (go to 'Console') and you will see logs.

JMWAH666 commented 1 year ago

Attached are 3 log files. I hope it has the information you’re looking for. If you want a screenshot of anything let me know File: web.whatsapp.com-1695397390081 was created when did a fresh connect to WhatsApp web and sent myself a text from my iPhone.

JMWAH666 commented 1 year ago

Someone just sent me a text. Attached is a fresh log.

JMWAH666 commented 1 year ago

Additional information you may find helpful.

I just tested the extension on another Windows 10 laptop and on a Windows 7 laptop.

It does not show if the messages were sent from a computer or phone.

JMWAH666 commented 1 year ago

Immediately after I sent you the last email (about 3 minutes ago), I received a text.

On the Windows 10 laptop it showed that the text was sent from a phone.

The Windows 7 laptop did not show anything.

For my use, the Windows 7 laptop is a non-issue.

I only used it to provide you with additional information.

I hope this information is helpful.

JMWAH666 commented 1 year ago

FYI, the feature just stopped working again.

If I’m overwhelming you with too many emails let me know and I will stop.

Have a good afternoon.

tomer8007 commented 1 year ago

You did not attach any files on GitHub and I did not receive them. Please attach them in the GitHub comment.

JMWAH666 commented 1 year ago

Here are the 4 files I sent by email yesterday,

web.whatsapp.com-1695397390081.log web.whatsapp.com-1695397223810.log web.whatsapp.com-1695396031524.log web.whatsapp.com-1695399222895.log

tomer8007 commented 1 year ago

Thanks for the logs. I think I can see the problem:

Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at MultiDevice.signalDecryptWhisperMessage (multi_device.js:221:30)
    at async MultiDevice.decryptE2EMessage (multi_device.js:182:27)
    at async NodeHandler.onNodeReceived (interception.js:427:24)
    at async Object.promise (interception.js:153:33)

So storage.loadSession(address.toString()); returns an object without sessions. Perhaps it's related to the specific contact you're getting messages from. I will try to figure out how it could happen.

JMWAH666 commented 1 year ago

Just FYI, when it worked, it worked with all my contacts. When it stopped working, it stopped working with all the contacts. For me it's been all or nothing.

JMWAH666 commented 1 year ago

Yesterday I had 2 laptops running side by side.

Out of a total of 16 messages received, sent by 3 different contacts (not group chats), the feature worked 2 times.

Of the 2 times it worked (1 time for contact#1 and 1 time for contact#2), it was not consistent on both laptops.

For example, a message on laptop#1 was correctly identified as being sent from a computer, but the same message did not indicate the source on laptop#2.

A few hours later a message on laptop#2 was correctly identified as being sent from a phone, but the same message did not indicate the source on laptop#1.

In addition, when the feature worked, if the person sent multiple texts in a row, only the first text showed the source of the message. All subsequent texts, including texts received from the contact in response to a message I sent, did not show the source of the contact's message

I have attached logs files for laptop#1 and laptop#2.

If you would like any additional information please let me know. Also kindly post if you resolved the issue.

Thanks and have a great day,

Laptop #1 web.whatsapp.com-1695567767843.log

Laptop #2 web.whatsapp.com-1695565587964.log

tomer8007 commented 1 year ago

Actually this time I do not see any useful errors in your attached logs.

What I would like you to do is see if you can find a consistent way to trigger this bug or find an error which you clearly see that is getting logged only when the bug happens.

tomer8007 commented 1 year ago

For example, when I see Passing-through incoming packet due to error: I do not understand what is the error. Maybe a screenshot of this line will be more clear. But again, what's important is to correlate the errors I see to the bug.

JMWAH666 commented 1 year ago

I can't trigger the bug as it's not something that I initiate. I have to wait for someone to send me a WhatsApp message to see if the device used is identified. However please note that the error is consistent in that since yesterday, only 2 of now more than 20 messages, showed the device used. The rest did not specify the device used. I have reloaded WhatsApp on both laptops and cleared the console information. The next time I receive a message I will save the logs and post them for you. I will also try to take screen shots. If you would like any additional information or want me to focus in on a specific item, phrase, type of error or event, let me know. Thanks.

tomer8007 commented 1 year ago

I now see that I also sometimes do not see the device from which a message was sent. Will try to investigate this in the upcoming days.

JMWAH666 commented 1 year ago

I received some messages from 2 different contacts this morning.

One laptop showed the device as a phone, for only the first message from each individual (subsequent messages did not show the device).

The other laptop did not show any device for any messages from either contact.

Here is the log file from the laptop that did not display a device.

web.whatsapp.com-1695758292071.log

tomer8007 commented 1 year ago

Perhaps it is a GUI problem somtimes. Looking.

JMWAH666 commented 1 year ago

One additional piece of information you may or may not find helpful.

Once a contact's device is identified, no future messages will show the device. The only way to get a device to appear again for that contact is to log out of WhatsApp web, open a new window, and then relink the phone to WhatsApp web. Then, if the contact sends me another message it MAY show the device. But, if I don't log out and relink WhatsApp web, it definitely will not show the device used to send the message.

tomer8007 commented 1 year ago

The device still shows up for me most of the time, I don't know. It could be related to the E2E message decryption feature which currently has some other problems, so I'm looking into these.

JMWAH666 commented 1 year ago

OK....

If I remember correctly, in April, I showed a friend how to use WhatsApp Web and the extension. I went to his place with my laptop and phone in hand. I sat in front of his computer and he watched as I sent him messages, switching back and forth between devices. I sent multiple messages in a row from the phone and all had the phone icon. Then I switched back and forth between the laptop and the phone and again, all of them had the correct icon identifying the device.

I only mention this incase you made modifications between then and now and perhaps something done since April changed the functionality of the feature.

tomer8007 commented 1 year ago

You can look at the commit history, I didn't make any modification that's related to this feature. I think it's more like a modification that WhatsApp made like usually happens...

JMWAH666 commented 1 year ago

I can't find the link to the history but it's OK, I believe you. I was just trying to provide you with as much information as possible to help you determine/resolve the issue.

tomer8007 commented 1 year ago

After some debugging I found that really WhatsApp changed some HTML in the profile image shown next to messages. image

This indeed made the device type icon invisible in groups. So I:

  1. Adapted the code the to GUI change in 16f214c4033a9e65b1faa212e75f468965b58a01, so that now device types are shown below the image as expected
  2. Made the device type logic not-dependent of the E2E decryption in b5085b91bf08f568c6cd5f95df059ce4b6beb086, so that missing the device type will be less likely
  3. Added code that prevents the device icon from getting added if it's already there

In addition, I discovered that WhatsApp changed the node parsing logic, which apparently messed up with the message restore feature. Fixed it in a8ff5fc47bdbc82f1fe16b5218c633d41ccbe214, and possibly another bug in eaf4033d274daf73ee68caae1b8f2ae207fd09ce.

These changes will be released as version 2.1.0. Please test the new version as soon as it will make its way to the store and tell me if it makes some improvements for you.

JMWAH666 commented 1 year ago

As soon as it's available I will test it and send you feedback. Do you have a projected time frame for it's release?

tomer8007 commented 1 year ago

It should get to the store either today or tomorrow I believe. Maximum a few days. UPDATE: I think it's live, have fun.

JMWAH666 commented 1 year ago

Excellent. I will be in touch sometime over the next week and I will post things to this "issue". Have a wonderful evening.

tomer8007 commented 1 year ago

It's even live now in the store.

JMWAH666 commented 1 year ago

Not as of 45 seconds ago, but I will keep my eye out for it and check regularly.

JMWAH666 commented 1 year ago

Just wanted to touch base and let you know that on October 1, 2023 the extension was updated to 2.1.0. Since the update, the feature has been accurately displaying the "Device of Messages", for ALL messages received, from ALL contacts (at least all contacts who have sent me messages since October 1st), on both laptops. I will keep you advised as needed. Thank you for the fix and for keeping me informed. It's greatly appreciated.

JMWAH666 commented 1 year ago

Question: Has anybody ever suggested or have you ever considered, in addition to "Device of Messages", also adding a feature to show IP Address of the source of the messages?

tomer8007 commented 1 year ago

It's not technically possible :-)