Comments (9)
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.
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.
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.
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.
@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.
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.
By the way, is there a chance it's an issue with Telegram servers? Just askin'.
from telebot.
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.
@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)
- Please update business bot
- query user not work use ReplyRecipient
- many old version reply HOT 1
- Here is some update for processing message reaction events
- How to forward a message to a specific topic in other groups. please help me HOT 4
- How can I detect if getUpdate failed? HOT 1
- The handler does not respond to OnChatMember for large groups. HOT 1
- bot: implement Trigger to trigger registered handler
- when i use img html tag, telegram: Bad Request: can't parse entities: Unsupported start tag "img" at byte offset 1 (400) HOT 2
- What is diffent and how send message by id?
- OnChatMember not catched
- selector inline mode handle not listener callback button pressed
- Cant catch forwarded messages
- ChatByUsername telegram: chat not found (400) HOT 4
- OnEdited method not response HOT 3
- The field "vcard" is missing in "Contact" HOT 1
- Missing Caption field in Photo if marshalled and unmarshalled back.
- Add test Context class for testing middlewares HOT 1
- markup will disappear after using force reply
- Have 'Validating data received via the Mini App' ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telebot.