How ResinFiles works

TLDR; ResinFiles is a cache between Salesforce and Google Drive. We cache the metadata of files and folders you have requested until they change or you are not using Salesforce for the rest of the day.

When ResinFiles loads in Salesforce, what happens?

  1. Salesforce loads up the Canvas App.
  2. Using VisualForce it injects the Record Name into a JSON payload sent within a Signed Request down to ResinFiles
  3. The payload is inspected and we work out which folder to load
  4. Using the OAuth token you let us use when you connected your Google Drive account, we make a request to Google for the folder’s metadata it’s contents.
  5. We cache this metadata for 60s. We cache the breadcrumbs for 60m
  6. We send the folder metadata to ResinFiles sitting inside of Salesforce and put the files/folders on screen.
  7. If you’ve viewed the folder before then we’ll check your preferences to see which view you’d like the folder shown as.

When I upload a file to Google Drive, what happens?

  1. The browser sends the file to a ResinFiles server
  2. Using your stored account details we make an API request to Google to put the file in the folder you specified
  3. We invalidate our cache of that folder
  4. Remove the file from our server
  5. Send your browser a message to say that the file has been uploaded
  6. The file appears on your screen and in Google Drive

Why don’t you upload the file straight to Google from the browser?

Because we will support multiple different storage backends and it is much easier to handle a consistent API for our front end.

What do we store on the servers?

See security

What are cached files in ResinFiles?

See caching

How might this change in the future:

  • When we bring in live syncing from Google Drive we will cache the folders as you open them up for the average duration you are logged in per day. This will speed the UI by 2x.
  • When our workflow tools land we will be storing a relationship between the Document/Folder ID in Google Drive and how far it’s progressing along it’s workflow. e.g. Pending/Under Review/Reviewed/Completed.
  • File previews of documents will inspect the first page if Google can’t provide a thumbnail (this is mainly applicable for businesses who use Apple’s suite of document tools). This will be an opt-in feature.