onedrive-api-docs: ODP Regression: OneDrive Graph API /delta deltaLink response is malformed

Category

  • Question
  • Documentation issue
  • Bug

Expected or Desired Behavior

The deltaLink should return the correct data

Observed Behavior

For the last 24hr’s ODP deltaLink response from the OneDrive API is malformed.

When calling /delta, the deltaLink is responding as per the following example:

[DEBUG] deltaLink: https://graph.microsoft.com/v1.0/drives('66d53be8a5056eca')/items('66D53BE8A5056ECA!101')/microsoft.graph.delta(token='aTE09NjM3NDI5NzI5OTI.....

Previously, this would respond as:

[DEBUG] deltaLink: https://graph.microsoft.com/v1.0/drives/66d53be8a5056eca/items/66D53BE8A5056ECA!101/delta?select=id%2cname%2ceTag%2ccTag%2cdeleted%2cfile%2

This means that the OneDrive Personal /delta and associated deltaLink response cannot be consumed or used. When attempting to use the bad deltaLink URL as provided by the API, it generates the following:

ERROR: OneDrive returned an error with the following message:
  Error Message:    HTTP request returned status code 400 (Bad Request)
  Error Reason:     Invalid API or resource
  Error Date:       2020-12-08T04:17:18
  Error Request ID: d704a5a7-35ff-472b-97d9-208f4f3286e2

Full Example:

[DEBUG] Attempting query 'changes = onedrive.viewChangesByItemId(driveId, idToQuery, deltaLink)'
[DEBUG] driveId: 66d53be8a5056eca
[DEBUG] idToQuery: 66D53BE8A5056ECA!101
[DEBUG] Previous deltaLink: https://graph.microsoft.com/v1.0/drives/66d53be8a5056eca/items/66D53BE8A5056ECA!101/delta?select=id%2cname%2ceTag%2ccTag%2cdeleted%2cfile%2cfolder%2croot%2cfileSystemInfo%2cremoteItem%2cparentReference%2csize&$skiptoken=aTE09...redacted
[DEBUG] Request URL = https://graph.microsoft.com/v1.0/drives/66d53be8a5056eca/items/66D53BE8A5056ECA!101/delta?select=id%2cname%2ceTag%2ccTag%2cdeleted%2cfile%2cfolder%2croot%2cfileSystemInfo%2cremoteItem%2cparentReference%2csize&$skiptoken=aTE09...redacted
[DEBUG] Query 'changes = onedrive.viewChangesByItemId(driveId, idToQuery, deltaLink)' performed successfully
[DEBUG] OneDrive API /delta response: {"@odata.context":"https:\/\/graph.microsoft.com\/v1.0\/$metadata#Collection(driveItem)","@odata.deltaLink":"https:\/\/graph.microsoft.com\/v1.0\/drives('66d53be8a5056eca')\/items('66D53BE8A5056ECA!101')\/microsoft.graph.delta(token='aTE09...redacted')?select=id%2cname%2ceTag%2ccTag%2cdeleted%2cfile%2cfolder%2croot%2cfileSystemInfo%2cremoteItem%2cparentReference%2csize&$skiptoken=aTE09...redacted","value":[{"@odata.type":"#microsoft.graph.driveItem","cTag":"adDo2NkQ1M0JFOEE1MDU2RUNBITEwMS42Mzc0Mjk3Mjk5MjE4MDAwMDA","eTag":"aNjZENTNCRThBNTA1NkVDQSExMDEuMQ","fileSystemInfo":{"createdDateTime":"2018-06-06T20:45:24.436Z","lastModifiedDateTime":"2019-04-24T07:09:31.29Z"},"folder":{"childCount":0,"view":{"sortBy":"takenOrCreatedDateTime","sortOrder":"ascending","viewType":"thumbnails"}},"id":"66D53BE8A5056ECA!101","name":"root","parentReference":{"driveId":"66d53be8a5056eca","driveType":"personal","id":"66D53BE8A5056ECA!0","path":"\/drive\/root:"},"root":{},"size":421686}]}

Steps to Reproduce

  1. Perform a /delta query for OneDrive Personal Accounts
  2. Analyse the /delta response

Currently this only impacts OneDrive Personal Accounts. OneDrive Business Accounts are not impacted

[ ]: http://aka.ms/onedrive-api-issues [x]: http://aka.ms/onedrive-api-issues

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 16
  • Comments: 25 (6 by maintainers)

Commits related to this issue

Most upvoted comments

This bug is not fixed - on a fresh sync, with no previous token, I’m still getting a malformed delta url:

https://graph.microsoft.com/v1.0/drives(‘9ada0xxxx073d0a’)/root/microsoft.graph.delta(token=‘aTE09NjM3NDY1MDA1OTEzOTM7SUQ9OUFEQTBFQURGQTA3M0QwQSExxxxxxx1OTQyMzA7RVA9MjA7U0k9MTI7RExFUDxxxxxxxU089MjtQST0z’)?select=name%2Cfile%2Cfolder%2CfileSystemInfo%2CparentReference%2Cdeleted&$skiptoken=aTE09NjM3NDY1MDEwNzY1ODM7SUQ9Oxxxx0QwQSExMDY7TFI9NjM3NDY1MjMyNjMwMzA7RVAxxxxxxExFUD0wO1NHPTE7U089MjtQST0z

Maybe related to this - sync in some cases never finishes because the delta link provided by the last API call (@odata.nextLink) keeps returning changes, even though nothing has actually changed.

This is not a problem in our app as far as we can tell, and sync has been working properly for several years. It’s just since this bug happened OneDrive became terribly unreliable for all our users. Is it a known issue and are there any plans to fix it?

We will certainly make an effort for planned breaking changes, which should be rare, if ever, and generally accompanied by a major version bump and announcement beforehand with plenty of time to adapt any clients.

As mentioned, this should have been a silent change but a portion of the feature was deployed in an “on” state before supporting code was deployed. The feature change will likely be re-enabled after all necessary parts of the code are verified to have rolled out to production later in the week or possibly next.

The feature this is intended to support is adding an OData annotation for deleted items in addition to our “Deleted” facet that currently shows up. We aren’t planning to remove the existing deleted indicator but we want to align with the rest of Microsoft Graph’s handling of Delta to be consistent. To do that requires a few other changes on our end, one of which is supporting the URL pattern that got enabled today.

Again, apologies for the disruption, we’ll continue to try to do better in the future.

@JeremyKelley Any update here? Has this functionality really been regressed for over 2 months?

Thank you for your contribution to OneDrive API Docs. We will be triaging your incoming issue as soon as possible.

Same problem here…

Same problem. should we upgrade the client or just wait msftbot?

Replying here too, we’re investigating the necessary fixes here and will let people know when we have a final fix in place.

In fact one users tried this:

As I’m a new Joplin user, I deleted everything and started again and also revoked/replaced the OneDrive auth but I still get the same error…

So it seems the bug is not fixed on OneDrive side yet?

Could someone explain what the issue is and how to fix it? I guess clients also need to do something since all of our users are now unable to use OneDrive for synchronisation (forum link).

Someone mentioned there that the delta link we cache should be cleared, but if we do that doesn’t it mean clients will have to re-download all the data?