telegram-history-dump icon indicating copy to clipboard operation
telegram-history-dump copied to clipboard

Missing messages in groups, from people not in contact list. Need to re-run the script.

Open stefanmaric opened this issue 9 years ago • 3 comments

I've been trying to export message history from some group chats. I got messages like the following in the process:

W, [2015-10-25T16:29:00.220902 #29023]  WARN -- : Message without date: {"event"=>"message", "id"=>372588}

And the json line ends up like:

{"event":"message","id":372588}

These come from certain users not in my contact list; but there are some others not in my contact list whose messages are exported correctly and I can't tell what determines whose messages are exported and whose not.

Then I noticed that if I re-run the script with same settings, no warnings are shown and all messages are exported. Like if they were cached in the first run so second one goes smoothly; maybe asynchronous calls to get the user info?

I repeatedly get this behavior with diff chats. I also get the same result if I delete my ~/.telegram-cli folder and start again.

stefanmaric avatar Oct 26 '15 03:10 stefanmaric

PD: Using:

vysheng/tg@3a898a42c10ed17ffeecb587ca09cdaa4b39e6b5

tvdstaaij/telegram-history-dump@18b00bb3599b9879b172d4e40216d0570886bb01

stefanmaric avatar Oct 26 '15 03:10 stefanmaric

I get these objects with just an id too, but assumed that they're just deleted messages or something. I think I do keep getting them even when I run the script many times though.

Anyway, this is very probably an issue with telegram-cli. These are the exact objects returned by telegram-cli when executing the history command. There may very well be some asynchronous stuff and caching going on in telegram-cli internally, but the communication between telegram-cli and this script is fully synchronous, and no additional information is requested or cached. It's also consistent between runs assuming the configuration is the same.

I expect this is reproducible by executing history commands manually though the regular CLI interface and if this is indeed the case you could file it as a telegram-cli issue. But while annoying, I guess it's a good thing that you can at least get every message after more than one run, considering this wasn't the case with the Python script.

tvdstaaij avatar Oct 26 '15 23:10 tvdstaaij

Just an update if someone reads:

I have been using this script to export my history. The bug persists, first attempt will lack a lot of data but second run with same config produces a perfect export.

stefanmaric avatar Nov 18 '15 15:11 stefanmaric