1
votes

I am working on c++ desktop application which syncs User Google docs to the local data base.

Applications retrieves Google docs and spreadsheets to the local by sending HTTP requests (sending HTTP requests using curl) Request https://docs.google.com/feeds/default/private/full

Here we are preserving each Google doc resource_id and other meta info in the data base for the next syncs.

Once initial sync is done, from the next sync onwards sending the following HTTP requests for getting the only updated resources

https://docs.google.com/feeds/default/private/full?updated-min=Value Here updated-min is previous XML updated-min value

Here while processing the resources identifying the Google doc is updated or not based on the previously saved Google doc "resource-id" value .

If current and previous "resource_id"(retrieved from data base) is same then considering as updated otherwise new one. Since according to Google Doc API "resource_id" is the unique identifier for the Google doc.

Actually response should contains only new/update resources which are modified after the "updated-min" time.

This logic was working fine till now (almost one year) and now suddenly seeing duplicate entries for the same Google doc in our database. (Noticed that it started appearing after Google Drive has introduced).

Also all duplicate entries of the same Google doc has got different resource id's, So We are treated each one as new entry result in duplicate entries of same Google doc.

Is "resource_id" is the right attribute for identifying uniqueness of resource.

Could you please help us in addressing this issue

Regards Subbi Reddy

1
Is that Grive, or something else? - Ali Afshar

1 Answers

1
votes

The field resource_id is the correct one to uniquely identify files stored in Google Docs, however, you should use the Changes feed to sync data instead of relying on the updated-min value:

https://developers.google.com/google-apps/documents-list/#detecting_changes_to_resources

Also, the recently released version 2 of the Drive API implements the same features, I'd recommend updating your app to use it instead of the Documents List API:

https://developers.google.com/drive/manage-changes