Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes last message is dumped again #35

Open
giomasce opened this issue Aug 2, 2016 · 2 comments
Open

Sometimes last message is dumped again #35

giomasce opened this issue Aug 2, 2016 · 2 comments

Comments

@giomasce
Copy link

giomasce commented Aug 2, 2016

The tool is working great, except for a small bug: for some chats at every execution of telegram-history-dump the last message is added again to the jsonl file (and therefore to the other formatters). For example:

{"event":"message","unread":false,"out":false,"text":"Такой статьи у меня в базе пока нет!\nI don't have this article in database yet","id":"010000004bebb509376a0000000000004c0bdeeeb86ea71d","flags":256,"from":{"first_name":"Sci-Hub","id":"$010000004bebb5094c0bdeeeb86ea71d","username":"scihubot","peer_type":"user","peer_id":162917195,"print_name":"Sci-Hub","flags":1,"last_name":""},"to":{"id":"$010000005fd382005407330023a867ff","first_name":"Giovanni","username":"giomasce","peer_type":"user","peer_id":8573791,"print_name":"Giovanni_Mascellani","flags":524289,"when":"2016-08-02 22:30:57","last_name":"Mascellani","phone":"[omitted]"},"service":false,"date":1470169330}
{"event":"message","unread":false,"out":false,"text":"Такой статьи у меня в базе пока нет!\nI don't have this article in database yet","id":"010000004bebb509376a0000000000004c0bdeeeb86ea71d","flags":256,"from":{"first_name":"Sci-Hub","id":"$010000004bebb5094c0bdeeeb86ea71d","username":"scihubot","peer_type":"user","peer_id":162917195,"print_name":"Sci-Hub","flags":1,"last_name":""},"to":{"id":"$010000005fd382005407330023a867ff","first_name":"Giovanni","username":"giomasce","peer_type":"user","peer_id":8573791,"print_name":"Giovanni_Mascellani","flags":524289,"when":"2016-08-02 22:27:21","last_name":"Mascellani","phone":"[omitted]"},"service":false,"date":1470169330}

At each execution, another similar row will be added to the top of the file. It happens with just a few chats, maybe one or two of the dozens I have. I cannot see any patter: I used to think that only happened when the last message was an attachment, but the example above disproves that.

@tvdstaaij
Copy link
Owner

It's hard to tell what causes this from this data alone (the surrounding messages could help), but since you opened this issue I thought that it was probably because of my workaround for vysheng/tg#1077. I did some digging in the telegram-cli code, and based on my findings I developed a new workaround that should be more reliable, which is now on master.

@tvdstaaij tvdstaaij reopened this Nov 11, 2016
@giomasce
Copy link
Author

It now seems to be working correctly. I'll let my script run for a few days and then I'll confirm. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants