go-tdlib icon indicating copy to clipboard operation
go-tdlib copied to clipboard

After few minutes of running listener stops getting updates

Open purex121 opened this issue 1 year ago • 4 comments

After few minutes of running listener stops getting updates.

purex121 avatar Apr 15 '24 11:04 purex121

yes,you can write a event func on the update channel by yourself

FunkyYang avatar Apr 23 '24 13:04 FunkyYang

the update channel is fulled

FunkyYang avatar Apr 23 '24 13:04 FunkyYang

I also encountered this problem and I printed updates with length 0

updates := tdlibClient.GetListener().Updates
for update := range updates {
  switch update.GetType() {
  case client.TypeUpdateNewMessage:
    newMessage, ok := update.(*client.UpdateNewMessage)
    if !ok {
      log.ZInfo(ctx, "Update", "updates", len(updates))
      continue
    }
    log.ZInfo(ctx, "Update", "class", update.GetClass(), "updates", len(updates))
    handlerMsg(ctx, newMessage.Message)
  default:
    log.ZInfo(ctx, "Update", "class", update.GetType(), "class", update.GetClass(), "updates", len(updates))
    continue
  }
}

qmarliu avatar Apr 25 '24 07:04 qmarliu

Do I need to consume Updates elsewhere? When I added a brand new user, I got stuck when I got close to 1000 messages after the first launch. But it worked the second time. What do I need to do on the first boot?

qmarliu avatar Apr 25 '24 09:04 qmarliu

Do I need to consume Updates elsewhere?

Yes, you have to consume Updates

completely rewritten in v1.0.0-beta1

zelenin avatar Mar 16 '25 13:03 zelenin