GithubHelp home page GithubHelp logo

Comments (9)

tucnak avatar tucnak commented on August 16, 2024

Hey,

I just realized that underlying interfaces are absolutely synchronous, which is quite strange, since I remember writing them with concurrency in mind. Anyway, I see the problem, but don't see any clear reasonable solution here. Gimme some time, I'll dive into tonight.

from telebot.

aladine avatar aladine commented on August 16, 2024

Hi Ian, I temporarily solve the issue. After checking the log, I realize 1/2 of pending messages are "/start" command.
I use another library to pick up those "/start" command and run sending response message to this type individually. After that, the origin go process is able to pick up and clear the messages in channel.
Btw, I don't find any bug in "/start" command code of my bot.

from telebot.

ejamesc avatar ejamesc commented on August 16, 2024

I've been running a fairly successful bot with this library for some time, and I see this problem every few weeks. (Basically no more new messages come through to my bot, despite a full Telegram queue and no auth errors).

The problem is with supplying an offset param to getUpdates. If one doesn't periodically supply an offset message id, Telegram's API servers will never mark old messages as confirmed, and will hold on to them until the message buffer is completely filled.

I manually made a request to Telegram's API servers with an offset param, and messages immediately started pouring through again.

Tell me if I'm missing something, @tucnak. (Say, if there's a feature to supply offset that I'm not aware of).

I'll take a stab at fixing this before the week is over.

from telebot.

ejamesc avatar ejamesc commented on August 16, 2024

Ok this is really odd. I see in your source code that you're incrementing the offset by 1 in Listen(), so why am I seeing this problem? I'll do more tests and report back.

from telebot.

tucnak avatar tucnak commented on August 16, 2024

@ejamesc Unfortunately, I couldn't reproduce this issue you and @aladine are talking about so far. The whole "offset based on the latest update id+1" idea is the only good idea I came up while hacking the fetcher and it seemed to work for me.

from telebot.

aladine avatar aladine commented on August 16, 2024

Until now I still get the same error every few weeks.
Is there any case @ejamesc, you skip sendMessase in processing channel and the index keeps increments continuously. You probably reach a point where update_index is larger than the actual index on Telegram server.

from telebot.

tucnak avatar tucnak commented on August 16, 2024

By the way, is there a chance it's an issue with Telegram servers? Just askin'.

from telebot.

ejamesc avatar ejamesc commented on August 16, 2024

Interesting! That's a good hypothesis @aladine, I've started logging my message ids, and will be watching out for this. Will confirm back in this thread if I find anything. 

_____________________________

From: aladine [email protected]
Sent: Thursday, November 12, 2015 8:40 PM
Subject: Re: [telebot] Channel messages is empty when there are full messages Telegram queue (#16)
To: tucnak/telebot [email protected]
Cc: Eli James (Cedric Chin) [email protected]

Until now I still get the same error every few weeks.
Is there any case @ejamesc, you skip sendMessase in processing channel and the index keeps increments continuously. You probably reach a point where update_index is larger than the actual index on Telegram server.


Reply to this email directly or view it on GitHub.

from telebot.

Ronmi avatar Ronmi commented on August 16, 2024

@aladine @ejamesc The offset is counter of Update.ID not Message.ID, so sending message should not affect it.

But another possible case is maybe the offset is actually a 64bit integer. By using int type in telebot, this will be a problem on 32bit machines. Is your bot running bot on 32bit machine or compiled on 32bit machine without cross compiling? Unlike chat id, the size offset is not specified in API documentation, so I'm not quite sure if this is the case.

from telebot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.