tdlib / td

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

`updateChatPosition` updates does not appear to emit for `chatListFolder` under specific conditions. #2474

Closed vincentneo closed 1 year ago

vincentneo commented 1 year ago

I realised that updateChatPosition does will not include anything with chatListFolder, if use_message_database is set to true, when send setTdlibParameters.

However, it only happens after the first time that message db is used.

For example,

  1. use_message_database is set to false. Use as per normal. Quit the app.
  2. use_message_database is set to true. Use as per normal. Quit the app.
  3. use_message_database is still set to true. Use as per normal, observe that updateChatPosition will not include anything relating to chatListFolder.

I assume by the third launch in the above scenario, it is cached in the db, and as a result, chatListFolder positions are some how gone.

All launches are fine if use_message_database is always set to false.

Tested with watchOS 9.5, compiled TDLib is 1.8.14, albeit not the latest commit.

levlam commented 1 year ago

Did you call loadChats for the folder?

vincentneo commented 1 year ago

oh... good point thanks I didn't do that and assumed it be fine (since it worked if false). Will test that out and report back. Thank you!

vincentneo commented 1 year ago

thanks @levlam once again!