remoteStorage

Understanding caching and sync


#1

#for each path on the storage, the universe can be in any of the following states:

  • it is a folder path (ending in a /) vs. it is a document path (not ending in a /)
  • the client had no access vs. read-only access vs. full access to it
  • a folder/document exists at the path in the client copy, yes vs. no
  • a folder/document exists at the path in the server copy, yes vs. no
  • the path is “used” vs. “treeOnly” vs. “released”
  • there may be a pending outgoing change
  • there may be a pending incoming change

#now:

  • if you do nothing, the library will always try to resolve all pending outgoing changes as soon as it can. there is no way to turn that off.
  • every 30 seconds (although this interval is configurable and can be disabled), the library will check for incoming changes. it will always resolve all incoming changes it finds this way, for all paths for which a local folder/document exists, as well as even if they don’t exist, all paths that are “used”, and all folders that are “used” or “treeOnly”.
  • if a document path is “used”, but no local copy exists, it will try to obtain a local copy.
  • if a folder path is “used” or “treeOnly”, but no local copy exists, it will try to obtain a local copy
  • by default, all paths are “used”, unless the client has no access to them.
  • this is what causes “initial sync”, as well as the polling every 30 seconds after that.