mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
Update architecture documentation
* Update architecture documentation
This commit is contained in:
parent
d13679f9c2
commit
11932fe021
|
@ -46,6 +46,9 @@ The diagrams below show the high level process flow and decision making when run
|
|||
### Processing a potentially changed local item
|
||||
![applyPotentiallyChangedItem](./puml/applyPotentiallyChangedItem.png)
|
||||
|
||||
### Download a file
|
||||
![downloadFile](./puml/downloadFile.png)
|
||||
|
||||
### Determining if an 'item' is syncronised between Microsoft OneDrive and the local file system
|
||||
![Item Sync Determination](./puml/is_item_in_sync.png)
|
||||
|
||||
|
@ -93,7 +96,7 @@ Due to this factor, when using `--resync` the online source is always going to b
|
|||
|
||||
## Client Functional Component Architecture Relationships
|
||||
|
||||
The diagram below shows the functional relationship of application code components, and how these relate to each relevant code module within this application:
|
||||
The diagram below shows the main functional relationship of application code components, and how these relate to each relevant code module within this application:
|
||||
|
||||
![Functional Code Components](./puml/code_functional_component_relationships.png)
|
||||
|
||||
|
|
BIN
docs/puml/downloadFile.png
Normal file
BIN
docs/puml/downloadFile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
63
docs/puml/downloadFile.puml
Normal file
63
docs/puml/downloadFile.puml
Normal file
|
@ -0,0 +1,63 @@
|
|||
@startuml
|
||||
start
|
||||
|
||||
partition "Download File" {
|
||||
|
||||
:Get item specifics from JSON;
|
||||
:Calculate item's path;
|
||||
|
||||
if (Is item malware?) then (yes)
|
||||
:Log malware detected;
|
||||
stop
|
||||
else (no)
|
||||
:Check for file size in JSON;
|
||||
if (File size missing) then (yes)
|
||||
:Log error;
|
||||
stop
|
||||
endif
|
||||
|
||||
:Configure hashes for comparison;
|
||||
if (Hashes missing) then (yes)
|
||||
:Log error;
|
||||
stop
|
||||
endif
|
||||
|
||||
if (Does file exist locally?) then (yes)
|
||||
:Check DB for item;
|
||||
if (DB hash match?) then (no)
|
||||
:Log modification; Perform safe backup;
|
||||
note left: Local data loss prevention
|
||||
endif
|
||||
endif
|
||||
|
||||
:Check local disk space;
|
||||
if (Insufficient space?) then (yes)
|
||||
:Log insufficient space;
|
||||
stop
|
||||
else (no)
|
||||
if (Dry run?) then (yes)
|
||||
:Fake download process;
|
||||
else (no)
|
||||
:Attempt to download file;
|
||||
if (Download exception occurs?) then (yes)
|
||||
:Handle exceptions; Retry download or log error;
|
||||
endif
|
||||
|
||||
if (File downloaded successfully?) then (yes)
|
||||
:Validate download;
|
||||
if (Validation passes?) then (yes)
|
||||
:Log success; Update DB;
|
||||
else (no)
|
||||
:Log validation failure; Remove file;
|
||||
endif
|
||||
else (no)
|
||||
:Log download failed;
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
}
|
||||
|
||||
stop
|
||||
@enduml
|
Binary file not shown.
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 158 KiB |
|
@ -9,7 +9,7 @@ note right: Query Microsoft OneDrive /delta API
|
|||
:Receive JSON responses;
|
||||
|
||||
:Process JSON Responses;
|
||||
partition "Process JSON Responses" {
|
||||
partition "Process /delta JSON Responses" {
|
||||
while (for each JSON response) is (yes)
|
||||
:Determine if JSON is 'root'\nor 'deleted' item;
|
||||
if ('root' or 'deleted') then (yes)
|
||||
|
@ -30,7 +30,6 @@ partition "Process JSON Responses" {
|
|||
:Discard JSON;
|
||||
else (no)
|
||||
:Process JSON (create dir/download file);
|
||||
|
||||
if (Is the 'JSON' item in the local cache) then (yes)
|
||||
:Process JSON as a potentially changed local item;
|
||||
note left: Run 'applyPotentiallyChangedItem' function
|
||||
|
@ -38,25 +37,28 @@ partition "Process JSON Responses" {
|
|||
:Process JSON as potentially new local item;
|
||||
note right: Run 'applyPotentiallyNewLocalItem' function
|
||||
endif
|
||||
|
||||
:Process objects in download queue;
|
||||
:Download File;
|
||||
note left: Download file from Microsoft OneDrive (Multi Threaded Download)
|
||||
:Save in local database cache;
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
}
|
||||
|
||||
partition "Perform data integrity check based on local cache database" {
|
||||
:Process local cache database\nto check local data integrity and for differences;
|
||||
if (difference found) then (yes)
|
||||
:Upload file/folder change including deletion;
|
||||
note right: Upload to Microsoft OneDrive
|
||||
note right: Upload local change to Microsoft OneDrive
|
||||
:Receive response with item metadata;
|
||||
:Save response to local cache database;
|
||||
else (no)
|
||||
endif
|
||||
}
|
||||
|
||||
:Scan local filesystem\nfor new files/folders;
|
||||
partition "Local Filesystem Scanning" {
|
||||
:Scan local filesystem\nfor new files/folders;
|
||||
while (for each new item) is (yes)
|
||||
:Check item against 'Client Side Filtering' rules;
|
||||
if (item passes filtering) then (yes)
|
||||
|
@ -70,9 +72,10 @@ partition "Local Filesystem Scanning" {
|
|||
endwhile
|
||||
}
|
||||
|
||||
partition "Final True-Up" {
|
||||
:Query /delta link for true-up;
|
||||
note right: Final Data True-Up
|
||||
:Process further online JSON changes if required;
|
||||
|
||||
}
|
||||
stop
|
||||
@enduml
|
||||
|
|
Loading…
Reference in a new issue