d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
736 stars 48 forks source link

Some WhatsApp chats are duplicated in the search menu #294

Open ricott1 opened 2 months ago

ricott1 commented 2 months ago

Description:

Some Whatsapp chats are duplicated in the ˆn search menu and indistinguishable from each other (see Screenshot). When opened, only one of them contains the messages, while the other are just empty. Maybe this has something to do with changing number.

The problem is only for WhatsApp (at least for me).

Screenshot 2024-09-14 at 10 00 51

How to reproduce it:

Try to search for a WhatsApp chat. Not all of them display this behaviour.

Environment:

d99kris commented 2 months ago

Hi @ricott1 - thanks for reporting this. I don't see the issue on my side, but I've added some new developer mode debugging capability in nchat just now (in 4b1190b / v5.2.11). If you get a chance to build and run latest nchat, then please try start it in developer mode like this: nchat -m

Then when opening the ^n dialog, it will display chat ids (which in the case of WhatsApp are phone numbers) next to each contact name. It's maybe not a good idea to share the actual numbers here in public, but you could perhaps let me know if all numbers of this contact look like real (and unique) phone numbers, and whether they seem to support your theory about contact having changed phone numbers?

Docbroke commented 2 months ago

This issue occurs with telegram also, it affects chats with changed names. As far as I can see nchat somehow displays old chat names that no are longer in use.

ricott1 commented 2 months ago

Hi @d99kris , thanks for picking this up. I built and ran in dev mode and indeed they look like real and unique phone numbers. I attach another screenshot (redacting the numbers ;) ). The same problem exists for other contacts, all of which (as far I as I can tell) display a different phone number. I don't have this problem with Telegram, but this could be just out of chance.

image

d99kris commented 2 months ago

Thanks for providing additional details, I have some idea what the issue is (basically nchat has a cache of contacts which is never pruned IIRC, contacts are only added). Will look into fixing this, but might take a little while. Meanwhile, if you're mainly using the contact list to navigate between existing chats (and not opening new chats), you can try the new goto chat function with key binding alt-n.

ricott1 commented 2 months ago

Thanks! I really appreciate your time for this :)

ricott1 commented 1 month ago

I was thinking, maybe a simpler workaround would be to allow to delete duplicate chats permanently on the UX? Maybe by persisting a list of filtered numbers that are just not shown. At least for me M-d does not work in achieving that.

d99kris commented 1 month ago

Thanks for the suggestion, yeah that should be a quicker (short-term) fix, will take a look.