tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
6.99k stars 1.43k forks source link

getChats returns every single chat #899

Closed morojenoe closed 4 years ago

morojenoe commented 4 years ago

Hello,

when I call getChats() with limit equals to 5, I receive from updates every single chat (nearly 100). Is it intended? Maybe I'm doing something in a wrong way? I use tdweb 1.5.0, config:

{
  useTestDc: false,
  databaseDirectory: 'tdlib',
  useFileDatabase: false,
  useChatInfoDatabase: false,
  useMessageDatabase: false,
  useSecretChats: false,
  apiId: ...,
  apiHash: ...,
  systemLanguageCode: 'en',
  deviceModel: getDeviceModel(),
  systemVersion: getSystemVersion(),
  applicationVersion: '1.0.0',
}

request parameters

{
        limit: 5,
        offsetOrder: '9223372036854775807',
        offsetChatId: 0
}
levlam commented 4 years ago

This is expected, The request will return at most 5 chats, but there can be more or less chats loaded and the updateNewChat updates sent. The updates are not directly related to any specific request and there are dozens cases leading to the update.