Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fetching updates that arrived while the client was offline #263
Comments
|
I noticed Client stops receiving raw_updates after some time. No exception or error was produced. |
|
It happens only in day time, when lot of events received. At night it works fine
Maybe some type of ping needed? Really need it to be working |
|
@djumpen did this happen to you only lately? Can you tell me exactly when you noticed this (date and time)? Or is it a recurring issue? |
|
@djumpen Looks like something changed server side starting from Layer 102 because me, you and some other people already experienced and reported the same issue these days. In details: the problem is that Telegram stops sending updates for some reason, but the underlying TCP socket and the MTProto connection are working fine. How do I know? There's already a ping mechanism implemented to keep the connection alive and iptraf reveals packets are being sent correctly. Moreover, I managed to inject a GetState request to the running process using pyrasite which made the server start sending updates again, without having to restart the script. This proves that Pyrogram has no important bug, it rather has a missing piece for handling such cases automatically, which should be added asap. Thanks for the feedback anyway! |
|
Any news about that topic? |
I don't think anyone cares. I tried to do it for personal purposes, but I gave up for now. In fact, you only need to store the latest state data, compare this with the getState on Client run and so on updates to call updates.getDifference. And make some changes in session.py to able capture this type of updates in case raw.types.RpcResult are skipped. |
Currently, Pyrogram will ignore all the updates that arrived while a client was offline, that is, a client that was manually stopped (in case of internal reconnections the missing updates are already correctly retrieved). Official documentation here https://core.telegram.org/api/updates.