Lonami / grammers

(tele)gramme.rs - use Telegram's API from Rust

Home Page:https://t.me/gramme_rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gap on update

gribodyr opened this issue · comments

I am using grammers as a userbot. I have an account which is subscribed to a large number of channels/chats.

When I launch my application and enter the update loop, in a short while the log starts to get flooded with the entries like these:

[2023-09-19T18:05:08Z INFO  grammers_session::message_box] gap on update for Channel(1042009118) (local 1742159, count 1, remote 1742174)
[2023-09-19T18:05:08Z INFO  grammers_session::message_box] gap on update for Channel(1110839896) (local 7470860, count 1, remote 7471058)
[2023-09-19T18:05:08Z INFO  grammers_session::message_box] gap on update for Channel(1110839896) (local 7470860, count 1, remote 7471061)
[2023-09-19T18:05:08Z INFO  grammers_session::message_box] gap on update for Channel(1110839896) (local 7470860, count 1, remote 7471063)
[2023-09-19T18:05:08Z INFO  grammers_session::message_box] gap on update for Channel(1042009118) (local 1742159, count 1, remote 1742174)

Thousands of these.

What could be the reason?

Did you test with the git version and not the one in crates io?

Thanks for the tip!

I checked out the repo a few weeks ago, wasn't using the crates.io version. I've just updated my copy and there are quite a few changed files. So I deployed it and am leaving it for a few hours to see if it enters that loop again.

Meanhile, would you mind answering a few questions?

  • how stable is the code base? I will probably mostly use the low level API. My userbots run unattended for weeks,
  • when does one need to save the session file after the initial session has been fully established? should it be done on a regular basis? or any other suggestions.

Thank you!

The library was born as a port of Telethon which has several years on its back. My hope is we will iron the kinks as more people use grammers. Features such as autoreconnect are not yet implemented (but are not bulletproof in Telethon either anyway. Anything dealing with IO should be a service with some restart policy anyway).

Session file contains the update state. If the program dies and you want to fetch missed updates when it goes back up, you should've saved the session prior to the crash.

For questions I would prefer if we used https://t.me/gramme_rs.

It's fixed, thank you for the tip and the answers!