question

APIPointNewbie-3149 avatar image
0 Votes"
APIPointNewbie-3149 asked saldana-msft edited

Graph Delta function is not so optimal in my code

Hello dear community,

I have the following problem, I have built a webhook that reacts to changes in my OneDrive, this also works perfectly.

But the delta functionality does not work as well as desired, if something changes after the start of the webhook I do not get what has changed, but only from the second change time I get the changes displayed.

What am I doing wrong ?

I would be very happy about help or tips.

Thanks in advance

greetings :-)



     private static object DeltaLink = null;

     private static IDriveItemDeltaCollectionPage lastPage = null;


     private async Task<IDriveItemDeltaCollectionPage> GetFiles(GraphServiceClient graphClient, object deltaLink)
     {

         IDriveItemDeltaCollectionPage page;

         if (lastPage == null)
         {
             var queryOptions = new List<QueryOption>() {
             new QueryOption("token", "latest"),//deltaToken=latest
             new QueryOption("$select", "name,id"),
             };
             page = await graphClient.Drives["{Drive-Id}"]
                                     .Items["{Folder-Id}"]
                                     .Delta()
                                     .Request(queryOptions)
                                     .GetAsync();

         }
         else
         {
             lastPage.InitializeNextPageRequest(graphClient, deltaLink.ToString());
             page = await lastPage.NextPageRequest.GetAsync();
         }

         lastPage = page;
          
         return page;
     }
microsoft-graph-sdkmicrosoft-graph-applicationsmicrosoft-graph-notifications
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I will try to reproduce your problem, please wait a moment.

1 Vote 1 ·

The strange thing is that I used your code to test and it did not respond to me with the correct results. Instead, it only returned all the Items to me. Can you provide a screenshot of the response?

0 Votes 0 ·

strange I do not have the complete contents of my folder.

0 Votes 0 ·

Would you please provide us with an update on the status of your issue?

0 Votes 0 ·

Hello, sorry for the late reply I did not get the penultimate message from them at all. Unfortunately the problem still exists

0 Votes 0 ·

0 Answers