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;
}