Forum Discussion
MSGraph not retrieving all messages from old chats
Using MSGraph to retrieve messages from some old chats (2-3 years ago), there is a disturbing behavior - on first run, with paging, it retrieves a number of messages, for example 138. Then on a next run, same parameters, the call retrieves only 38. What is missing are the 100 most recent messages.
After waiting some period of time, like next day, it starts again to retrieve all messages for a while, then starts again getting the reduced set.
I can reproduce the issue both in code and using MSGraph explorer. And also when trying to open those messages in Teams Desktop application with a link like this:
https://teams.microsoft.com/l/message/{chatId}/{messageId}?context=%7B%22contextType%22%3A%22chat%22%7D
it opens the chat, but does not display the message, instead showing a banner that the messages was "deleted" (it most certainly isn't)
It looks like there is some issue on the Teams server backend.