diff --git a/docs/client-architecture.md b/docs/client-architecture.md index de1cd7bd..90ee6b7e 100644 --- a/docs/client-architecture.md +++ b/docs/client-architecture.md @@ -44,11 +44,9 @@ The diagrams below show the high level process flow and decision making when run ![applyPotentiallyNewLocalItem](./puml/applyPotentiallyNewLocalItem.png) ### Processing a potentially changed local item +![applyPotentiallyChangedItem](./puml/applyPotentiallyChangedItem.png) ### Determining if an 'item' is syncronised between Microsoft OneDrive and the local file system - -The following activity diagram details the function within the application which determines wether an item is syncronised between Microsoft OneDrive and the local file system: - ![Item Sync Determination](./puml/is_item_in_sync.png) ### Determining if an 'item' is excluded due to 'Client Side Filtering' rules diff --git a/docs/puml/applyPotentiallyChangedItem.png b/docs/puml/applyPotentiallyChangedItem.png new file mode 100644 index 00000000..cbb7f956 Binary files /dev/null and b/docs/puml/applyPotentiallyChangedItem.png differ diff --git a/docs/puml/applyPotentiallyChangedItem.puml b/docs/puml/applyPotentiallyChangedItem.puml new file mode 100644 index 00000000..58ed2d53 --- /dev/null +++ b/docs/puml/applyPotentiallyChangedItem.puml @@ -0,0 +1,48 @@ +@startuml +start +partition "applyPotentiallyChangedItem" { + :Check if existing item path differs from changed item path; + if (itemWasMoved) then (yes) + :Log moving item; + if (destination exists) then (yes) + if (item in database) then (yes) + :Check if item is synced; + if (item is synced) then (yes) + :Log destination is in sync; + else (no) + :Log destination occupied with a different item; + :Backup conflicting file; + note right: Local data loss prevention + endif + else (no) + :Log destination occupied by an un-synced file; + :Backup conflicting file; + note right: Local data loss prevention + endif + endif + :Try to rename path; + if (dry run) then (yes) + :Track as faked id item; + :Track path not renamed; + else (no) + :Rename item; + :Flag item as moved; + if (item is a file) then (yes) + :Set local timestamp to match online; + endif + endif + else (no) + endif + :Check if eTag changed; + if (eTag changed) then (yes) + if (item is a file and not moved) then (yes) + :Decide if to download based on hash; + else (no) + :Update database; + endif + else (no) + :Update database if timestamp differs or in specific operational mode; + endif +} +stop +@enduml