Commit Graph

296 Commits

Author SHA1 Message Date
Hannah von Reth
2efbc96880 VFS: Tell the vfs plugin whether we have multiple accounts
This allows us to decide on the presentation of the account
2020-06-23 12:23:20 +02:00
Olivier Goffart
fc69d5271e Run clang-tidy check for modernize-use-nullptr 2020-02-10 16:41:07 +01:00
Hannah von Reth
583b54c367 Don't ignore file sync notification after an unlock
For a usual file sync event we check for actual changes in the local file,
after an unlock the local file might be unchanged so we need to sync it anyhow.

Fixes: owncloud/enterprise#3609
2019-12-16 19:56:02 +01:00
Christian Kamm
1269843c3c Vfs: Retain existing data when enabling vfs #7302
Previously all local data was deleted because the root folder was marked
as OnlineOnly.
2019-07-10 14:15:45 +02:00
Christian Kamm
6b89747a26 VfsSuffix: Wipe stale pin states #7273
Previously the pin states of deleted files stayed in the 'flags'
database and could be inadvertently reused when a new file with the same
name appeared. Now they are deleted.

To make this work right, the meaning of the 'path' column in the 'flags'
table was changed: Previously it never had the .owncloud file suffix.
Now it's the same as in metadata.path.

This takes the safe parts from #7274 for inclusion in 2.6. The more
elaborate database schema changes (why use 'path' the join the two
tables in the first place?) shall go into master.
2019-06-27 15:57:20 +02:00
Christian Kamm
831e718b0c FolderWatcher: Become unreliable if test notification fails #7241
Necessary for some filesystems on windows that don't have full file
watching capabilities.
2019-06-14 08:04:16 +02:00
Christian Kamm
03b65e210b Vfs: Mark sqlite temporaries excluded on db-open #7141
The previous patch ensured that the sqlite temporaries weren't deleted
and recreated for every sync run, but there was still time between
client startup and the first sync run where they would have the
"needs-sync" icon.
2019-04-26 13:51:18 +02:00
Christian Kamm
04268becd1 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.
2019-04-09 12:46:35 +02:00
Christian Kamm
4a2d74062a owncloudcmd: Use env vars for chunk sizes #7078
Moves a bunch of env var reading from Folder into SyncOptions.
2019-04-09 10:08:01 +02:00
Christian Kamm
aca19c7a6d Vfs: Hydrating a virtual is SYNC not NEW #7101
Previously it'd be NEW(ItemTypeFile), but now it has changed to be
SYNC(ItemTypeVirtualFileDownload) which allows better classification.
2019-03-28 17:30:28 +01:00
Christian Kamm
f1602a7cb7 Notifications: Don't say "downloaded" for new files #7101
These files may very well just be new virtual files that were explicitly
*not* downloaded.
2019-03-28 17:30:28 +01:00
Christian Kamm
6ee2c9c595 Protocol, Notifications: Show destination() instead of _file
destination() now consistently points to the file after the successful
sync operation. _file might be the place the item was moved from.
2019-03-28 17:30:19 +01:00
Christian Kamm
cb5a76729a FolderWatcher linux: Make automatically recursive #7068
Previously it depended on addFolder() / removeFolder() calls to adjust
watchers when new folders were added or removed. There also needed to be
complex move handling.

Now, any folder creation/move-in notifications automatically trigger
watcher additions and folder deletion/move-out triggers removal.
2019-03-14 08:14:27 +01:00
Christian Kamm
a627f373b1 Ensure local discovery on selective sync changes
As far as I'm aware local discovery can be skipped on folders that are
selective-sync blacklisted, so a local discovery is required when an
entry is removed from the blacklist.

Also rename
avoidReadFromDbOnNextSync() -> schedulePathForRemoteDiscovery()
since the old name might also imply it's not read from db in the local
discovery - which is not the case. Use Folder::
schedulePathForLocalDiscovery() for that.
2019-02-14 10:57:09 +01:00
Christian Kamm
f9a573b2ac File watcher: Pin state attribute changes are valid notifications
Previously they would be discarded since the file's mtime or size hadn't
changed.
2019-02-11 13:35:14 +01:00
Christian Kamm
210f309e6e PinStates cleanup
- SyncJournalDB functions now behind internalPinStates() to avoid
accidental usage, when nearly everyone should go through Vfs.
- Rename Vfs::getPinState() to Vfs::pinState()
2019-02-11 13:35:14 +01:00
Christian Kamm
c500866a78 Folder: Add remoteFolderTrailingSlash()
There were cases where the "/" exception wasn't handled correctly
and there'd be extra slashes in generated paths.
2019-02-11 13:35:14 +01:00
Christian Kamm
63e11dc8da Vfs: Call unregisterFolder() when folder is removed 2019-02-11 13:35:14 +01:00
Christian Kamm
010abe4c82 Pin state updates
- unspecified and inherited are different
- move enum to header in common/
- access through Vfs instead of directly in Journal
2019-02-11 13:35:14 +01:00
Christian Kamm
136670b8c2 Vfs: Send SyncFileStatusTracker data to vfs plugins 2019-02-11 13:35:14 +01:00
Christian Kamm
c4c5e4e14c Folder: Add selective sync / ui related flags
supportsSelectiveSync(): clearer than !supportsVirtualFiles() and allows
  extra logic

isVfsOnOffSwitchPending(): Somewhat awkward way of dealing with the
  phase between a user requesting vfs state to be switched and it
  actually happening
2019-01-18 11:16:14 +01:00
Christian Kamm
ad81454cdc vfs: Add vfs migration options to folder context menu
This allows enabling and disabling vfs.

To distinguish this operation from setting the root pin state, the
availability setting is adjusted as well to be similar to the
menu that shows in the shell extensions.
2019-01-18 10:59:12 +01:00
Christian Kamm
3f45e0defe vfs: Allow (de-)hydrating the full sync folder 2019-01-18 10:59:12 +01:00
Christian Kamm
46098a160d vfs: Don't assume suffix mode for old folders
That would break with old folders that use selective sync.
2019-01-18 10:59:12 +01:00
Christian Kamm
421c0b447e Merge remote-tracking branch 'origin/2.5' 2019-01-15 11:18:24 +01:00
Markus Goetz
a3f3546879 Sync: Display theme in debug log 2019-01-11 11:28:53 +01:00
Christian Kamm
df1723c9b2 vfs: Remove newFilesAreVirtual - use root PinState instead
This unifies how to deal with pin states.

Also enable reading a folders direct pin state vs its effective pin
state.
2019-01-07 10:09:03 +01:00
Christian Kamm
5211d9a8b1 Database: Change path for new dbs to .sync_* #5904
This is to avoid issues on OSX, where the ._ prefix has special meaning.

Originally (before 2.3.2) ._ was necessary to guarantee exclusion. But
since then the .sync_ prefix is excluded as well.

This does not affect existing database files.
2018-12-19 10:14:25 +01:00
Christian Kamm
0b35d901eb Vfs: Ensure older versions gracefully ignore winvfs folders
Previously there'd likely be a mess if a 2.6 winvfs folder was attempted
to be used with a 2.5 client. Now the older clients will ignore these
folders.
2018-12-18 15:16:40 +01:00
Christian Kamm
18ab3f5dcd vfs: Separate vfs availability from new-files-virtual
This helps support 2.5 settings where there are virtual files in the
tree but new files aren't created virtual.

It's also a prelude for #6815

There's currently no way of
- upgrading vfs plugins (a silent suffix->winvfs upgrade is attempted
  once only, when moving to master)
- disabling vfs capabilities outright
2018-11-26 13:02:48 +01:00
Christian Kamm
711cdb9df4 vfs: ensure backwards-compatible settings value is always set 2018-11-26 13:02:48 +01:00
Christian Kamm
4f56366fd5 vfs: Ensure SyncOptions::_vfs is never null
- Create a VfsOff derived class
- Make it a shared pointer shared with Folder::_vfs
2018-11-26 13:02:48 +01:00
Christian Kamm
572775a382 vfs: Ensure local discovery is done on dehydration request 2018-11-26 13:02:48 +01:00
Christian Kamm
1f4565923e Folder settings: Keep "usePlaceholders" to be backwards compatible 2018-11-26 13:02:48 +01:00
Christian Kamm
6d0f9a50ad vfs: Be more careful about Vfs instance ownership 2018-11-26 13:02:48 +01:00
Christian Kamm
c84ad025b3 vfs: Improve modeFromString() signature 2018-11-26 13:02:48 +01:00
Christian Kamm
a99289442e vfs: Fix dealing with missing vfs instance
Maybe there should just be a VfsOff instance to make this less error
prone.
2018-11-26 13:02:48 +01:00
Christian Kamm
202a2ba7ad vfs: Make switching vfs on/off work again 2018-11-26 13:02:48 +01:00
Christian Kamm
59a114cd4d vfs: Fix plugin decision in wizards, sanitize loading 2018-11-26 13:02:48 +01:00
Christian Kamm
0281aaf544 vfs: Allow folders without vfs 2018-11-26 12:59:51 +01:00
Christian Kamm
06928a4037 winvfs: initial work
Done by ckamm and dschmidt
2018-11-26 12:53:30 +01:00
Christian Kamm
96df14f897 FolderMan: Remove assumption of unique running sync 2018-11-26 12:47:31 +01:00
Olivier Goffart
9f43d8e0ab Revert "Database: future-proof to allow downgrade from future version"
This commit does not need to be in 2.6, it is only supposed to be in 2.5.1

This reverts commit a97f6fcfb2.
2018-10-31 16:30:06 +01:00
Olivier Goffart
a699903122 Merge remote-tracking branch 'origin/master' into new_discovery_algo
Conflicts:
	src/libsync/discoveryphase.cpp
2018-10-31 16:29:29 +01:00
Olivier Goffart
8aee6426af Merge remote-tracking branch 'origin/2.5' 2018-10-31 16:26:45 +01:00
Olivier Goffart
a97f6fcfb2 Database: future-proof to allow downgrade from future version
The 2.6 client will introduce an index that depends on a custom
function.
This causes insersion onto the metadata database to fail if the database
it opened with older version of the client. (Which will cause the client
to abort)

Delete this index in this version in order to allow downgrade.

In addition, allow to load folder with version '2', but still write
version '1' in the config file

Of course this commit need not to be in the 2.6 release
2018-10-31 11:30:35 +01:00
Christian Kamm
7519c64e86 Settings: Make FoldersWithPlaceholders group sticky
If virtual files are disabled on a folder it might still have db entries
or local virtual files that would confuse older client versions.
2018-10-29 19:54:21 +01:00
Olivier Goffart
2e16f654ea Merge remote-tracking branch 'owncloud/master' into new_discovery_algo
Conflicts:
	src/csync/csync_update.cpp
        test/csync/csync_tests/check_csync_update.cpp
2018-10-18 13:22:29 +02:00
Olivier Goffart
7daf393c1c Merge remote-tracking branch 'origin/2.5'
Conflicts:
	ChangeLog
2018-10-18 13:05:34 +02:00
Olivier Goffart
6ca5facbaf Account Settings: Add a context menu entry to enable or disable virtual files
Issue #6725
2018-10-17 09:05:32 +02:00