fabianonline / telegram_backup

Java app to download all your telegram data.
GNU General Public License v3.0
450 stars 91 forks source link

Messages from single chat are empty #42

Closed LivelyAlex closed 7 years ago

LivelyAlex commented 7 years ago

I tried to create a backup, and in general everything looks good, but messages from one chat are written to the database as empty, without text and data.

select count(*) from messages where messages.message_type='empty_message' 10241

i created log file with full output of program, with parameters --debug --trace --anonymize, maybe this helps. What else can I do to understand the problem? image log.txt

LivelyAlex commented 7 years ago

Can this be because this chat is a supergroup?

fabianonline commented 7 years ago

TL;DR: Quite possibly.

Disclaimer: This is knowledge about Telegram's internals I acquired by observing. I do not know for sure if this is correct, because there are no recent docs of Telegram's internals.

There is a fundamental difference between dialogs and groups on the one side and supergroups and channels on the other side: Messages sent in dialogs and groups get stored for each of the individual participants. Channels or supergroups have their own storage which is accessible for everyone joining the channel / supergroup. You can see this difference when joining a group: In a normal group, you won't see any of the older messages (unless someone forwards them to you). In a channel of supergroup, you can just scroll back and see "everything".

An empty_message is a message that once existed in your account, but doesn't do so anymore. I think what happened is that that group was at some time converted to a supergroup. At that moment, your copies of the group's messages became unnecessary and were deleted from your account.

Why do you think all those messages are from one specific chat? As far as I know they could be from any chat - the EmptyMessage object I receive from Telegram contains just the ID, nothing more. No way for me to find out to which chat this message belonged.

LivelyAlex commented 7 years ago

Why do you think all those messages are from one specific chat?

in my telegram account i have ~10 small chats and 1 big with ~90% of all messages, more than 100 000 messages. Perhaps this 10 000 empty messages not from this chat, ok. But then is there any way to create a backup copy of the supergroup using your program?

fabianonline commented 7 years ago

But then is there any way to create a backup copy of the supergroup using your program?

At the moment not. I'm planning on adding backup functionality for supergroups and channels, but time is short at the moment and other features have a higher priority for me.

Is it okay to close this ticket?

LivelyAlex commented 7 years ago

yes, thank you