td icon indicating copy to clipboard operation
td copied to clipboard

how to maintain a active main chat list as telegram client?

Open gillbates opened this issue 2 years ago • 7 comments
trafficstars

Hi Team,

we've tried the java example: https://github.com/tdlib/td/blob/b3ab664a18f8611f4dfcd3054717504271eeaa7a/example/java/org/drinkless/tdlib/example/Example.java#L248

and we make a test scenario:

1, login a new account A without any chats: 2, A send message to a friend and thus a chat 1 is created. 2, A create a basic group with friend and thus chat 2 is created. 3, A delete the chat 1 from mac telegram client ui. 4, now we use gcs, and mainChatList shows a list with size 1 (only chat 2 there), this is correct. 5, At mac telegram client ui, we click to leave group (chat 2). now no more chats on UI. 6, if we use gcs again or even restart this class, it will always return the list with size 1 (chat 2 still there) 7, we even tried to send a GetChats after step 5

 TdApi.GetChats chats = new TdApi.GetChats();
        chats.limit = 1000;
        TdApi.ChatListMain chatListMain = new TdApi.ChatListMain();
        chats.chatList = chatListMain;
        haveFullMainChatList = false;
        client.send(chats, defaultHandler);

but it will still return a result list contains chat 2.

anyone has an idea about this?

gillbates avatar May 08 '23 01:05 gillbates

Could you log in at https://web.telegram.org to see, whether the chat 2 is present?

levlam avatar May 08 '23 09:05 levlam

Could you log in at https://web.telegram.org to see, whether the chat 2 is present?

@levlam

chat 2 is not there both at web & mac telegram.

You could reproduce this by steps above, it could 100% be reproduced ...

gillbates avatar May 08 '23 09:05 gillbates

I can't reproduce this. When I leave a group from another app, it disappears. Could you reproduce this if the other app is TDLib-based?

levlam avatar May 08 '23 09:05 levlam

@levlam

my reproduce step:

1, start this Example java. 2, login into web telegram. 3, use gcs, and now it will print chat 2. 4, leave chat 2 in web telegram 5, use gcs or restart java, it will still print chat 2

it will disappear from your side?

gillbates avatar May 08 '23 10:05 gillbates

The chat disappears on my side. Could you send full TDLib log to https://t.me/tdlib_bot?

For this you need to comment the line, which sets verbosity level to 0:

   Client.execute(new TdApi.SetLogVerbosityLevel(0));

levlam avatar May 08 '23 11:05 levlam

The mentioned issue happens because server doesn't send updates for the chat list change to the app, but some workarounds were added to TDLib to mitigate the issue.

levlam avatar Jun 12 '23 12:06 levlam

yes...wait for updates and fix ...

gillbates avatar Jun 12 '23 13:06 gillbates