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?
- Salesforce loads up the Canvas App.
- Using VisualForce it injects the Record Name into a JSON payload sent within
a Signed Request down to ResinFiles
- The payload is inspected and we work out which
folder to load
- 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.
- We cache this metadata for 60s. We cache the breadcrumbs for 60m
- We send the folder metadata to ResinFiles sitting inside of Salesforce and
put the files/folders on screen.
- 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?
- The browser sends the file to a ResinFiles server
- Using your stored account details we make an API request to Google to put
the file in the folder you specified
- We invalidate our cache of that folder
- Remove the file from our server
- Send your browser a message to say that the file has been uploaded
- 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?
What are cached files in ResinFiles?
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.