bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
790 stars 38 forks source link

No Avatar pictures after deleting *.bin files #83

Closed Emporea closed 1 year ago

Emporea commented 1 year ago

I deleted all .bin files from the output folder and recreated a backup out of it. ( I had signal showing up about 80mb "phantom" attachment files, even tho I deleted everything from the app menu)

Everything worked, I have my old messages with a much smaller backup size.

But Signal doesnt show any avatars anymore and wont load them. Also the Data Storage option in Signal still shows around 80mb of "phantom" attachments, even tho my backup file is only ~15mb.

Since these errors are probably database related is there a way to "repair" these 2 things?

bepaald commented 1 year ago

So, did you delete all the bin files, *.bin, or only all the attachments Attachment_*.bin? If you deleted them all, those were also the Avatars. I'm kind of surprised this worked at all, there is a specific function for this (did you check out the README?)

My first suggestion would be to run signalbackup-tools [input] [passphrase] --deleteattachments -o [output] using the original backup as input. I'd hope you see fewer problems after that, but please do let me know as it's an experimental function.

If it is not possible to use the original backup file, and you need to work with this backup, let me know. I think it shouldn't be too difficult, probably just a DELETE * FROM part, should do it. However, nothing will bring back the Avatars if you deleted them (I do think they should eventually come back though, just from periodic profile updates).

Emporea commented 1 year ago

Yes I deleted every .bin file, not only attachments*.bin :D

Yeah i am not able to use the old backup cause i have new messages since..

So your guess is that the avatars will come back once a person has updated their picture? Do you know of any other method to refresh the existing avatars?

  1. question: do you know what i mean by phantom attachments?
bepaald commented 1 year ago

Yes I deleted every .bin file, not only attachments*.bin :D

Ok. oopsie! :-)

Yeah i am not able to use the old backup cause i have new messages since..

Gotcha

So your guess is that the avatars will come back once a person has updated their picture? Do you know of any other method to refresh the existing avatars?

I think so. There may be some timestamp somewhere that marks a profile out-of-date. I vaguely remember dealing with something like that in a GH issue here in the past. I will try to find it later.

question: do you know what i mean by phantom attachments?

not completely. I assume the app still shows 80MB worth of attachments in the media-overview? Is there more to it? Please tell me exactly what you mean.

I am a bit busy the rest of the week. If I find some time I will think about what needs to be done and write up some instructions.

If you don't want to wait, the first thing you could do (it may even be all that's needed) is: 1 delete any new attachments you have received since you did this. 2 export a new backup 3 run: signalbackup-tools [input] [passphrase] --runsqlquery "DELETE FROM part" -o [output] 4 import the new backup and see if that fixes the phantom attachments

PLEASE KEEP THE NEW ORIGINAL BACKUP (CREATED IN STEP 2) IN CASE SOMETHING GOES WRONG!

bepaald commented 1 year ago

So, after inspecting the code I believe it would be impossible to open a backup directory if the .bin files were missing, unless the .sbf were deleted as well. Is this correct? (Just for any future problems. If you do unsupported things and then cause an issue, you should be very precise in telling devs what exactly you did, I can't guess it and I'm trying to help you)

If you also deleted the sbf files, then I think the command above should fix your problems. To make the avatars re-appear (this is not foolproof, and some avatars may take some time or not re-appear at all), also add "UPDATE recipient SET last_profile_fetch = 0, signal_profile_avatar = NULL". These two commands can be combined, the full command will be:

signalbackup-tools [input] [passphrase] --runsqlquery "DELETE FROM part" --runsqlquery "UPDATE recipient SET last_profile_fetch = 0, signal_profile_avatar = NULL" -o [output]

Let me know if this fixes things or if you need more help.

bepaald commented 1 year ago

Feel free to post again if you need more help. Just closing this as cleanup, due to lack of response.