td icon indicating copy to clipboard operation
td copied to clipboard

SearchMessages misses the latest message

Open Nevershot opened this issue 2 months ago • 4 comments

Why the SearchMessages method returns one less message than expected. I sent Q1, Q2, Q3. FoundMessages.totalCount = 3, message[Q2, Q1]. If I send a message Q4 FoundMessages.totalCount = 4, message[Q3, Q2, Q1]. If I send a message Q5 FoundMessages.totalCount = 5, message is[Q4, Q3, Q2, Q1]. The problem is not the limits. Can you please tell me how to solve the problem and how the "query" works? I always send a string with a space " ", but if I send an empty string "" it stops matching.

        TdApi.FoundMessages foundMessages = client.sendSync(new TdApi.SearchMessages(
                new TdApi.ChatListMain(),
                " ",
                "",
                10,
                new TdApi.SearchMessagesFilterEmpty(),
                null,
                0,
                0
        ));

Version: 1.8.50

Nevershot avatar Nov 19 '25 00:11 Nevershot

😂

On Tue, Dec 2, 2025, 4:27 AM babutuhin77-dev @.***> wrote:

babutuhin77-dev left a comment (tdlib/td#3510) https://github.com/tdlib/td/issues/3510#issuecomment-3600007903

1764645972273670474349787062055.jpg (view on web) https://github.com/user-attachments/assets/72f2754c-c234-4e64-8f23-cd8232f25aa0

— Reply to this email directly, view it on GitHub https://github.com/tdlib/td/issues/3510#issuecomment-3600007903, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLBYQ2PXMSFX4VH6WNMBC4D37UBKBAVCNFSM6AAAAACMQOYM3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMBQGAYDOOJQGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Abudl68 avatar Dec 02 '25 03:12 Abudl68

@

babutuhin77-dev avatar Dec 02 '25 03:12 babutuhin77-dev

Are you ready to transfer

On Tue, Dec 2, 2025, 4:39 AM babutuhin77-dev @.***> wrote:

babutuhin77-dev left a comment (tdlib/td#3510) https://github.com/tdlib/td/issues/3510#issuecomment-3600034166

@

— Reply to this email directly, view it on GitHub https://github.com/tdlib/td/issues/3510#issuecomment-3600034166, or unsubscribe https://github.com/notifications/unsubscribe-auth/BLBYQ2LS2WKPAX7BTJNERO337UCVJAVCNFSM6AAAAACMQOYM3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMBQGAZTIMJWGY . You are receiving this because you commented.Message ID: @.***>

Abudl68 avatar Dec 02 '25 03:12 Abudl68

TDLib will never send to the app too new messages that are newer than the newest known message in the chat. You will receive the messages through updateNewMessage first when the chat state is updated, which is supposed to happen soon after.

Also, searchMessages is not supposed to be used to get all messages. New messages are received through updateNewMessage updates. You can also receive messages within specific chat using getChatHistory.

levlam avatar Dec 08 '25 10:12 levlam