Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/csync
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2019-04-03 14:32:05 +0300
committerKevin Ottens <kevin.ottens@nextcloud.com>2020-12-15 12:58:46 +0300
commit590db285419ab3eeae8f7f87542fa1642ec4fad3 (patch)
treef87abe1deb7376e159bc8a3d55b7dfa521bc6a5e /src/csync
parent2738f110f230a425c7bec0a0b068bb3c50802134 (diff)
Vfs: Clear up relationship between _type and pin state
The pin state is a per-item attribute that has an effect on _type: AlwaysLocal dehydrated files will be marked for hydration and OnlineOnly hydrated files will be marked for dehydration. Where exactly this effect materializes depends on how the pin states are stored. If they're stored in the db (suffix) the dbEntry._type is changed during the discovery. If the pin state is stored in the filesystem, the localEntry._type must be adjusted by the plugin's stat callback. This patch makes pin states behave more consistently between plugins. Previously with suffix-vfs pin states only had an effect on new remote files. Now the effect of pinning or unpinning files or directories is as documented and similar to other plugins.
Diffstat (limited to 'src/csync')
-rw-r--r--src/csync/csync.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/csync/csync.h b/src/csync/csync.h
index 13125cc8e..cc9e1c1a6 100644
--- a/src/csync/csync.h
+++ b/src/csync/csync.h
@@ -142,16 +142,26 @@ enum ItemType {
/** A ItemTypeVirtualFile that wants to be hydrated.
*
- * Actions may put this in the db as a request to a future sync.
+ * Actions may put this in the db as a request to a future sync, such as
+ * implicit hydration (when the user wants to access file data) when using
+ * suffix vfs. For pin-state driven hydrations changing the database is
+ * not necessary.
+ *
* For some vfs plugins the placeholder files on disk may be marked for
- * dehydration (like with a file attribute) and then the local discovery
+ * (de-)hydration (like with a file attribute) and then the local discovery
* will return this item type.
+ *
+ * The discovery will also use this item type to mark entries for hydration
+ * if an item's pin state mandates it, such as when encountering a AlwaysLocal
+ * file that is dehydrated.
*/
ItemTypeVirtualFileDownload = 5,
/** A ItemTypeFile that wants to be dehydrated.
*
- * May exist in db or local files, similar to ItemTypeVirtualFileDownload.
+ * Similar to ItemTypeVirtualFileDownload, but there's currently no situation
+ * where it's stored in the database since there is no action that triggers a
+ * file dehydration without changing the pin state.
*/
ItemTypeVirtualFileDehydration = 6,
};