.NET error when trying to page through teams chat messages

Abin Simon 0 Reputation points

When calling graph API https://graph.microsoft.com/v1.0/chats/{chat-id}/messages we get the following error with HTTP 400 when following the link in nextLink(ie calling with skiptoken).

Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.

A quick search lead me to dotnet/runtime#26868. Could this be an issue at the server side?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,410 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,124 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 385 Reputation points Microsoft Vendor

    Hi Abin Simon,

    Thanks for reaching out!

    I understand that you are getting 400 error while querying endpoint-https://graph.microsoft.com/v1.0/chats/{chat-id}/messages

    400 error occurs when the request can't be processed because it's malformed or incorrect.

    I tried to reproduce from my end by retrieving the chat messages https://graph.microsoft.com/v1.0/chats/{chat-id}/messages

    User's image

    And try to execute the skiptoken from the response generated. I am able to get the success response.

    User's image

    Could you please verify that the skiptoken is being properly included in the URL. If it’s missing or malformed, it could lead to a 400 error.

    Hope this helps.

    If the reply is helpful, please click "Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".