Editing Non downloaded files - KevinMackenzie/MyOneDriveClient GitHub Wiki
Public Acess
This is a description of how editing non-downloaded files should happen. In order to properly model, we must first determine how the operation should work on a broad level.
First, a consumer must signal to the back-end that the file should be downloaded. The back-end then downloads the file into a separate location and returns the location of where the file will be once the file is done downloading. The progress of this download can be seen like any other request. Once the cached file location recognizes that the file hasn't been accessed in a while, it will be deleted from the cache. Or, maybe the cache is a fixed size and it will only delete elements when the cache gets too big.
Internal Function
The item metadata and the events that fire from it are what drives much of this application's function, so a perhaps a flag in the item metadata marking whether the file is cached should be set upon request. This sends an event to download the file and the contents-update events that are created from local/remote are no longer filtered out. Maybe another element of the metadata is the name of the cache file, which is separate from the regular file stores. These events are still sent through the regular pipeline, but there will be a piece of extra data marking the event as for a cached file and not its link in the regular file system.