When a file changes on Google Drive the realtime model is getting deleted and a new one gets created. Is there a way to prevent this behaviour to be able to update the existing model with the new content of the file stored on drive?
2 Answers
Unless something has changed since the realtime launch, the answer is no. The reason why this happens is because the realtime model is tied to your app. So anytime a file is edited outside your app the realtime model has to get deleted. The only way to get around this would be to be to have a priority file format that only your app can edit.
This is the reason why you can only open Google Docs files in Google Docs. I believe the file formats are based on open document formats so you should be able to edit them outside of Google Docs. However, since the file formats also include realtime features you have to edit them in Google Docs or they would get out of sync.

- 1,321
- 2
- 12
- 18
-
Makes kind of sense - but as I'm storing a lot of additional data (like comment positions etc.) in the realtime model this "feature" will remove all the data in my model each time the file changes. It would be much better if I could simply update my model on the server whenever the file changes. Now we have the server side update method this really changed the game IMO. – dflorey Oct 28 '13 at 19:07
-
Since you can also get push notifications of updates, I think it is a possibility but definitely a feature that you would need to request. – PizzaPanther Oct 29 '13 at 13:47
If you create a shortcut file (https://developers.google.com/drive/integrate-create#create_a_shortcut_to_a_file) and associate the Realtime data with that, the Realtime data is not deleted or recreated unless the user deletes the shortcut file.
If you don't want the shortcut file to be visible in the user's Drive, you can store it in the Application Data folder (https://developers.google.com/drive/appdata).

- 411
- 2
- 4
-
Can I open multiple realtime models with the same client? So can the javascript client handle both a shortcut and a blob realtime model at the same time? – dflorey Nov 14 '13 at 09:00