msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

NextLink does not show up in AdditionalData

Open adricl opened this issue 2 years ago • 1 comments

Describe the bug When using the Delta query on teams messages with more than 20 messages we should have the URL for the @odata.nextLink in the Additional Data. This is not appearing.

To Reproduce Steps to reproduce the behavior:

            _graphClient
                .Teams[teamId]
                .Channels[channelId]
                .Messages
                .Delta()
                .Request()
                .Top(20);

then query the Additional data. chatPage.AdditionalData;

We do see the chatPage.NextPageRequest populated. chatPage.NextPageRequest.GetHttpRequestMessage().RequestUri.AbsoluteUri this does get the skip token. We can see when we inspect the NextPageRequest.QueryOptions the skip token details, so we can see it is populating. We can even call the GetAsync and it will get the next page, but we are not able to get this URL with skip token as we would expect.

Expected behavior I would expect the additional data to have the nextlink token. As per the docs https://docs.microsoft.com/en-us/graph/api/chatmessage-delta?view=graph-rest-1.0&tabs=http#initial-request-response

Screenshots If applicable, add screenshots to help explain your problem.

I have had to do this to get the URL with skip token

            if (messages.NextPageRequest != null && messages.NextPageRequest.RequestUrl != null && messages.NextPageRequest.QueryOptions.Count > 0)
            {
                var query = messages.NextPageRequest.QueryOptions[0];
                nextLinkUrl = $"{messages.NextPageRequest.RequestUrl}?{query.Name}={query.Value}";
            }

Additional context Using .netcore and the latest version of the sdk 4.19.0 and core version 2.0.8

adricl avatar Mar 01 '22 23:03 adricl

I have updated my initial Ticket with more details.

adricl avatar Jun 22 '22 06:06 adricl