carderne/signal-export

Renaming of chat names introduces errors

Closed this issue · 1 comments

Hi, and thanks for this awesome repo!

An issue I ran into when exporting my Signal chats was with the fix_names function. Currently, it just deletes all non-alphanumeric characters in each chat name, which can lead to a couple of errors:

1. Chats with names comprising solely from non-alphanumeric characters get renamed to empty strings
For example, if there is a chat with name like
non-alnum,
it will get rewritten to an empty string and hence the directory with the exported chat history will be in the main directory of all other chat histories
non-alnum-export
(the media folder of that chat is also in the main export directory).

2. No duplicate chat name handling
I think there can be a case of two chats having the same name, and these should then be handled separately and not merged. I'm not sure if this is relevant, but in my case when I run the script with the --verbose flag, the log shows that I have two chats/contacts with the same name yet different profileName (one being None):
same-name
(I have modified the if log branch print statement to show profileName as well, i.e. appended , aka {result[4]} to the print statement).
Then in the final output, these get merged into a single chat. In my case one of these chats is empty, so that is not a problem, but I think this could lead into some data loss if there are actually two different non-empty chats with same name.

I just tried fixing these in the accompanying PR, let me know what you think and, of course, request changes where required 😊.

Thanks once again!

Fixed in #30