2

I'm accessing OneDrive on a mobile app using the msgraph iOS SDK. I want to allow the user to manage a file's versions and for that I'm using the list versions API. In addition, I'm caching already downloaded files on the mobile device. I have encountered an issue with OneDrive personal, which behaves slightly different than OneDrive business concerning file versions.

It seems that when listing a file’s versions, personal assigns ‘current’ as the version id for the current version, whereas business sets an actual unique id. This behavior prevents me from assigning a unique identifier to the data that I cache on the device and so I can’t know whether there is a newer version on the backend that I should download.

I found a workaround which I feel is not the best solution - I'm using the file's cTag field. The documentation states that a cTag is:

An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only.

Using the cTag as a unique id for the current version allows me to detect that a new version has been uploaded.

The reason I'm not happy with using it, is that the cTag is only available for the current version. On the other hand, the unique id is only available for non-current versions. Once a newer version is uploaded and an id is assigned to the previously current version, I have no way to know that I already downloaded this version and marked it with the previous cTag.

Is there a way that I could get a consistent unique identifier for a file's version? For example, if the cTag could somehow be made available in list versions API? Or, alternatively, get the unique id of the current version?

Thanks!

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
galsh83
  • 550
  • 3
  • 16

0 Answers0