1
votes

I am using the Google Drive REST Api to get a list a revisions (https://developers.google.com/drive/v2/reference/revisions/list).

I have two problems with this:

  1. The number of revisions is inconsistent. I always get the same last 30 revisions but the total quantity ranges between 70 and 98. Each time I do the call, I get a different number of revisions.

  2. I keep the revision ids for later use (for backup purposes) and when I come back and call GET on the Revisions API (https://developers.google.com/drive/v2/reference/revisions/get), the first few revisions return a 'Revision not found' and some random ones also return the same error.

I can reproduce this behavior in my app but also directly on the API's documentation page.

Is there a way to know which versions are 'permanent' so I don't keep them for later use?

Thanks!

1

1 Answers

0
votes

Based on the Manage Revisions page, you're getting "Revision not found" due to the automatic purges made by the service for disk space optimization.

Google Drive automatically purges (or "prunes") revisions in order to optimize disk usage. To prevent this from happening, you can set the boolean flag keepRevisionForever to true to mark revisions that you don't want Drive to purge.

As indicated, you can set the keepRevisionForever flag on a specific revision for it to not be purged.