Questions tagged [google-drive-realtime-api]

As of November 2017 Google deprecated the Realtime API, and it is unavailable for new projects. It will stop working on December 11th 2018. It provided collaboration as a service for files in Google Drive via the use of operational transforms. The API was a JavaScript library hosted by Google that provided collaborative objects, events, and methods for creating collaborative applications.

The Realtime API lets you, the developer, design a shared data model that looks just like a local, in-memory data model. You write code to manipulate maps, lists, and your own custom JavaScript data model objects. When your code makes a change to the data model on behalf of some user, the data model automatically changes for all the users on the document.

These collaborative data model objects work just like local in-memory data model objects, with one exception. Unlike a local JavaScript data model, a collaborative Realtime API data model may change as a result of edits that were made by someone other than the current user. As a result, applications need to attach listeners to a collaborative document so that the UI may be updated to reflect remote changes.

The Realtime API is based on the same collaboration technology used by Google Docs. Whenever a collaborative data model is modified, the change is applied immediately to the local, in-memory copy of the document. The API then silently sends a representation of the change to the server (called a "mutation") so that the change can be recorded in the document and communicated to other collaborators. The mutations have been carefully designed so that conflicts between collaborators can always be automatically resolved, so users will never have to see a message about edit conflicts.

Realtime data models are "eventually consistent." That means that if all collaborators stop editing, eventually everyone will see the same data model. However, we make no guarantees about when all the collaborators will see the changes or what order the changes will be delivered in.

See https://developers.google.com/drive/realtime

520 questions
2
votes
1 answer

Is it possible to access google drive realtime api from a Firefox extension

I know GDRA is available for Chrome extensions, but I need it for Firefox. If I choose the "Web" option I need to provide an OAuth return address, which I don't have of course. Is there a way around this, or can I use the Chrome version of GDRA with…
retorquere
  • 1,496
  • 1
  • 14
  • 27
2
votes
1 answer

How to work with Realtime 'get' and 'update' api requests?

I am trying to understand how the Realtime API Resource Model is "shaped", in order to work with 'get' and 'update' features. Unfortunately documentation doesn't not say nothing about it…
rsileoni
  • 76
  • 4
2
votes
0 answers

How to catch error 500 in realtime api?

I'm getting error code 500 in the javascript console when modifying a CollaborativeString using the realtime api: POST…
dflorey
  • 1,828
  • 3
  • 19
  • 31
2
votes
0 answers

500 (Internal Server Error) when changing collaborative string

I'm adding a chunk of characters (by copy / pasting it into the editor) to a collabortivestring but this just give error 500. POST…
dflorey
  • 1,828
  • 3
  • 19
  • 31
2
votes
1 answer

"Failed to load resource" when using Realtime API

When working with the realtime API I sometimes get this error: Failed to load resource: the server responded with a status of 400 (Unknown SID)…
dflorey
  • 1,828
  • 3
  • 19
  • 31
2
votes
1 answer

Google Realtime API and Sharing Permissions Timing Issue

In a nutshell, what we are seeing is that if we create a new realtime document and immediately share it with another collaborator, and that collaborator loads the realtime document upon seeing it show up in their "Shared with me" folder, then when…
Cezanne
  • 21
  • 1
2
votes
1 answer

Error 500 when trying to load realtime document of a document file

I can create a shortcut file like so: gapi.client.drive.files.insert( {'resource': {'title': 'shortcut document', 'mimeType': 'application/vnd.google-apps.drive-sdk'}} ).execute(); and subsequently load a realtime document with…
2
votes
2 answers

Google Realtime API - How to view existing collaboration model?

How do I view existing realtime collaboration data model? I call getRoot method: var collaborative_model = rtpg.realtimeDoc.getModel().getRoot() When I vew collaborative_model object in debug, I see cryptic properties only. Not sure if or how my…
dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
2
votes
0 answers

Why is the same fileID use to search files in google drive fail on realtime api?

I got the fileID from a file and it works when I try to search it. But, when I try to use the same fileID to do gapi.drive.realtime.load(fileID, onFileLoaded, initializeModel); it returns an error 404 (Not Found) Drive Realtime API Error:…
2
votes
0 answers

Google drive API and auth

I want to create a web app letting any user upload a file to my Google drive and then be able to view it through the browser. So far looking at Google's examples it seems I have to auth to my Google Drive on the server side (makes sense....) but…
2
votes
1 answer

Google Drive Realtime API - Adding Collaborative list

From the documentation, it says I can have a collaborative list which contains other collaborative objects, namely another collaborative list. Therefore in my "onFileLoaded" event, I have the following code: var myRoot =…
TomYip
  • 43
  • 4
2
votes
1 answer

Batch insert permissions API with Google Drive API in Javascript

I'm trying to set permissions to several files in Google Drive using their API. I'd like to batch the insert permission API So far, this is what I tried: var httpBatch = gapi.client.newHttpBatch(); for(var fileIndex = 0; fileIndex < files.length;…
2
votes
1 answer

Google Drive Realtime API, how should I model SVG in the collaborative model

What would be a good or recommended way to model SVG DOM tree in Google's Realtime API? Specifically, stringify the SVG DOM tree and choose a collaborative string model or is there a better way? Thanks.
TomYip
  • 43
  • 4
2
votes
0 answers

Realtime api work very slow after 30-50 object changes

I found that my prototype with realtime API start work very slow (more than 200-500 milliseconds for collaborative map set operation and this number still grows after 10-20 changes. You can try oficial Playground…
idkras
  • 21
  • 1
2
votes
1 answer

Realtime API for model synchronization

I am looking to extend an existing JavaScript/CoffeeScript application using the realtime API. What I want to do is synchronize a map used by the Model of my application, part of an MVC framework spinejs. This would require that all the operations…
Giannis
  • 5,286
  • 15
  • 58
  • 113