Olivier Goffart [Fri, 30 Nov 2018 14:31:10 +0000 (15:31 +0100)]
Port the exclude test to the QTest Framework
This is just a port to QtTest, I did not change the layout of the test.
I did search and replace to replace the assert with QCOMPARE/QVERIFY
I still call setup and setup_init like before (only explicitly, now)
Also ported the preformence tests to QBENCHMAK because windows don't have
gettimeofday.
Relates #6358
Olivier Goffart [Fri, 30 Nov 2018 14:08:30 +0000 (15:08 +0100)]
Test: Move the test for Utility::normalizeEtag to testutility.cpp
I just moved the text and did the minimum to port it to QtTest
Did not change hte layout of it.
Relates #6358
Olivier Goffart [Fri, 30 Nov 2018 13:40:47 +0000 (14:40 +0100)]
Remove check_csync_util
It's testing nothing.
Only that one can convert a csync instruction to a string.
But this is only used in debug anyway
Relates to #6358
Christian Kamm [Tue, 18 Dec 2018 09:10:19 +0000 (10:10 +0100)]
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.
Christian Kamm [Tue, 18 Dec 2018 10:28:25 +0000 (11:28 +0100)]
Vfs: Have a static list of potential plugins for now
Fixes in-source builds and other cases where more non-plugin directories
are created in src/libsync/vfs.
Christian Kamm [Tue, 18 Dec 2018 09:47:45 +0000 (10:47 +0100)]
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.
Christian Kamm [Tue, 18 Dec 2018 09:31:17 +0000 (10:31 +0100)]
Vfs plugins: Available plugins must load
A plugin that can't be loaded due to dependency issues should not be
considered as available.
Olivier Goffart [Tue, 18 Dec 2018 09:38:39 +0000 (10:38 +0100)]
SyncEngine: Ensure that the paths passed to the discovery ends with slashes
This was making the tx.pl test fail
Olivier Goffart [Wed, 20 Jun 2018 13:46:58 +0000 (15:46 +0200)]
Propagator: Don't abort sync on error 503
Only do it when it is actually a maintenance mode
Issues #5088, #5859, https://github.com/owncloud/enterprise/issues/2637
Olivier Goffart [Mon, 3 Dec 2018 10:20:46 +0000 (11:20 +0100)]
Allow to open log window via command line to already running client
Issue: #4098
Dominik Schmidt [Tue, 11 Dec 2018 10:17:15 +0000 (11:17 +0100)]
Fix installation of vfs suffix plugin
Olivier Goffart [Fri, 7 Dec 2018 10:15:45 +0000 (11:15 +0100)]
VFS: Plugin needs to be installed, otherwise it can't be loaded
Olivier Goffart [Fri, 7 Dec 2018 09:06:56 +0000 (10:06 +0100)]
Fix compilation warning
src/libsync/propagatorjobs.cpp:63:10: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
[this, &deleted](const QString &path, bool isDir) {
^~~~~
Christian Kamm [Mon, 26 Nov 2018 12:03:39 +0000 (13:03 +0100)]
vfs: Make Vfs ctor explicit
Christian Kamm [Mon, 26 Nov 2018 10:33:29 +0000 (11:33 +0100)]
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
Christian Kamm [Mon, 26 Nov 2018 09:41:14 +0000 (10:41 +0100)]
vfs: Don't always load plugins, check metadata
Christian Kamm [Wed, 21 Nov 2018 11:26:59 +0000 (12:26 +0100)]
vfs: ensure backwards-compatible settings value is always set
Christian Kamm [Wed, 21 Nov 2018 11:23:08 +0000 (12:23 +0100)]
vfs: Ensure SyncOptions::_vfs is never null
- Create a VfsOff derived class
- Make it a shared pointer shared with Folder::_vfs
Christian Kamm [Thu, 15 Nov 2018 09:26:48 +0000 (10:26 +0100)]
vfs: Switch order of deletion and journal removal in dehydration
To be more crash-resilient.
Christian Kamm [Thu, 15 Nov 2018 09:16:25 +0000 (10:16 +0100)]
vfs: Update outdated comment
Christian Kamm [Thu, 15 Nov 2018 09:14:26 +0000 (10:14 +0100)]
vfs: Ensure local discovery is done on dehydration request
Christian Kamm [Thu, 15 Nov 2018 08:51:11 +0000 (09:51 +0100)]
Folder settings: Keep "usePlaceholders" to be backwards compatible
Christian Kamm [Thu, 15 Nov 2018 08:45:14 +0000 (09:45 +0100)]
vfs: Be more careful about Vfs instance ownership
Christian Kamm [Thu, 15 Nov 2018 08:30:27 +0000 (09:30 +0100)]
vfs: Remove VfsSuffixPrivate
Christian Kamm [Thu, 15 Nov 2018 08:27:35 +0000 (09:27 +0100)]
vfs: Document ignored return value.
Christian Kamm [Thu, 15 Nov 2018 08:24:24 +0000 (09:24 +0100)]
Plugin: Drop PluginLoader
Christian Kamm [Thu, 15 Nov 2018 08:07:08 +0000 (09:07 +0100)]
Plugin: style fixes
Christian Kamm [Thu, 15 Nov 2018 08:06:23 +0000 (09:06 +0100)]
Checksums: Make file ownership more explicit
Christian Kamm [Thu, 15 Nov 2018 08:01:46 +0000 (09:01 +0100)]
vfs: Improve modeFromString() signature
Christian Kamm [Thu, 15 Nov 2018 07:32:17 +0000 (08:32 +0100)]
Generalize Result<> class, add Optional<>
To make it nicer to use outside of HTTP results.
Christian Kamm [Thu, 15 Nov 2018 07:16:16 +0000 (08:16 +0100)]
vfs: Add API docs
Dominik Schmidt [Wed, 14 Nov 2018 11:12:14 +0000 (12:12 +0100)]
Remove unused include directories
Christian Kamm [Wed, 14 Nov 2018 09:44:34 +0000 (10:44 +0100)]
vfs: Fix dealing with missing vfs instance
Maybe there should just be a VfsOff instance to make this less error
prone.
Dominik Schmidt [Tue, 13 Nov 2018 23:11:02 +0000 (15:11 -0800)]
Fix export of vfs functions
Dominik Schmidt [Tue, 13 Nov 2018 20:01:23 +0000 (12:01 -0800)]
Cleanup CMake (output)
Christian Kamm [Tue, 13 Nov 2018 14:30:59 +0000 (15:30 +0100)]
vfs: Add check for presence of win plugin
Christian Kamm [Tue, 13 Nov 2018 12:31:39 +0000 (13:31 +0100)]
vfs: Make switching vfs on/off work again
Christian Kamm [Tue, 13 Nov 2018 10:46:26 +0000 (11:46 +0100)]
vfs: Fix plugin decision in wizards, sanitize loading
Christian Kamm [Mon, 12 Nov 2018 11:24:08 +0000 (12:24 +0100)]
vfs: Reenable local metadata updating of vfs files
Christian Kamm [Mon, 12 Nov 2018 11:23:49 +0000 (12:23 +0100)]
vfs: Make some behaviors suffix-vfs specific
Christian Kamm [Mon, 12 Nov 2018 11:23:22 +0000 (12:23 +0100)]
vfs: Allow remote renames to propagate as such
Christian Kamm [Mon, 12 Nov 2018 10:31:15 +0000 (11:31 +0100)]
vfs: Allow folders without vfs
Christian Kamm [Mon, 12 Nov 2018 10:27:09 +0000 (11:27 +0100)]
Fix big-folder detection when vfs is disabled
Christian Kamm [Sat, 10 Nov 2018 12:30:15 +0000 (13:30 +0100)]
vfs: Implement dehydration tagging
Christian Kamm [Fri, 9 Nov 2018 17:24:37 +0000 (18:24 +0100)]
vfs: Fix suffix detection and handling
Christian Kamm [Fri, 9 Nov 2018 11:17:24 +0000 (12:17 +0100)]
winvfs: Better error reporting
- fix download and validation error reporting
- add tests
Christian Kamm [Wed, 7 Nov 2018 11:36:29 +0000 (12:36 +0100)]
Fixes after rebase to master
- use vfs suffix in ProcessDirectoryJob
- fix include vfs.h
- fix local vio passing vfs
- fix checksum computation
- vfs mode use
- mingw lambda compile issue
Christian Kamm [Wed, 15 Aug 2018 08:46:16 +0000 (10:46 +0200)]
winvfs: initial work
Done by ckamm and dschmidt
Christian Kamm [Thu, 26 Nov 2020 16:19:20 +0000 (17:19 +0100)]
FolderMan: Remove assumption of unique running sync
Christian Kamm [Thu, 26 Nov 2020 16:12:11 +0000 (17:12 +0100)]
Checksums: Work on QIODevice*s
Needed for cfapi where we want to feed data through a custom device
which retrieves data from the windows api.
Olivier Goffart [Thu, 29 Nov 2018 11:10:59 +0000 (12:10 +0100)]
IgnoreListEditor: increase a bit the size
Should Help for issue #6641
Olivier Goffart [Thu, 22 Nov 2018 07:46:33 +0000 (08:46 +0100)]
Account: Fix crash when deleting an account
We should not have request parented to the account, otherwise we might get
a loop on the deletion order.
Issue #6893
Christian Kamm [Mon, 12 Nov 2018 12:47:28 +0000 (13:47 +0100)]
LockWatcher: Add chrono header
Christian Kamm [Mon, 12 Nov 2018 12:45:56 +0000 (13:45 +0100)]
Olivier Goffart [Fri, 9 Nov 2018 15:43:35 +0000 (16:43 +0100)]
cjhash: use Q_FALLTHROUGH
This fixes the warning
warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
Issue #6872
Kevin Ottens [Thu, 26 Nov 2020 15:55:04 +0000 (16:55 +0100)]
Excludes: switch all the path handling to QString
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Olivier Goffart [Tue, 20 Nov 2018 16:10:46 +0000 (17:10 +0100)]
CMakeLists.txt: increment sqlite version
3.9 is required for custom index to work
Olivier Goffart [Tue, 6 Nov 2018 14:44:22 +0000 (15:44 +0100)]
csync_vio_locale: use QString for the path in opendir
So we don't have to convert to utf8 and back again
Olivier Goffart [Wed, 7 Nov 2018 10:09:41 +0000 (11:09 +0100)]
Remove csync_misc: The code no longer use fnmatch
Olivier Goffart [Thu, 26 Nov 2020 15:22:50 +0000 (16:22 +0100)]
Exclude: do everything with QString wiuthout converting to char*
Olivier Goffart [Tue, 6 Nov 2018 11:16:32 +0000 (12:16 +0100)]
ProcessDirectoryJob::process: optimize so there is only one map
Olivier Goffart [Tue, 6 Nov 2018 10:46:01 +0000 (11:46 +0100)]
PropagateUpload: Avoid many allocations by using QByteArrayLiteral
Olivier Goffart [Tue, 6 Nov 2018 09:45:22 +0000 (10:45 +0100)]
Optimisation: Add a cache SyncJournalDb::mapChecksumType
No need to do two sql query for something that's always the same and
there are very few checksum types
Olivier Goffart [Tue, 6 Nov 2018 09:30:33 +0000 (10:30 +0100)]
Sync: optimize by removing setFileRecordMetadata
Inh most case we already have a record from before, so avoid doing a useless
lookup in the database.
In owncloudpropagator.cpp, directories do not have a checksum so no need
to call a function that preserves it
Olivier Goffart [Tue, 6 Nov 2018 08:48:13 +0000 (09:48 +0100)]
Test System: Optimisations so the benchmark is significant
Olivier Goffart [Tue, 6 Nov 2018 08:47:34 +0000 (09:47 +0100)]
OwnSql: Speedup by avoiding allocating an error string on success
Gerhard Gappmeier [Fri, 9 Nov 2018 12:39:50 +0000 (13:39 +0100)]
owncloudcmd: fix compiliation with TOKEN_AUTH_ONLY
Gerhard Gappmeier [Thu, 8 Nov 2018 17:17:29 +0000 (18:17 +0100)]
libsync: Fix build error with TOKEN_AUTH_ONLY
When enabling TOKEN_AUTH_ONLY, the code path using QPainter is disabled.
So we also don't need the includes.
This header is not available for Remarkable.
Gerhard Gappmeier [Thu, 8 Nov 2018 17:15:52 +0000 (18:15 +0100)]
Disable stack protector features when cross compiling
When cross-compiling this for remarkable using the poky toolchain
this results in linker errors with stack protector: libssp_nonshared.a
not found
Gerhard Gappmeier [Thu, 8 Nov 2018 17:15:04 +0000 (18:15 +0100)]
Add CMake option to disable GUI build
Kevin Ottens [Thu, 26 Nov 2020 18:08:17 +0000 (19:08 +0100)]
Get DatabaseErrorTest to pass
The E2EE code path would get the engine to go wrong in case of db error.
It's just better to have a failing upload or failing mkdir later in those
cases.
Emitting signals from a ctor is a bad idea anyway
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Olivier Goffart [Thu, 26 Nov 2020 14:27:03 +0000 (15:27 +0100)]
Test that the sync behave well if there are errors while reading the database
Olivier Goffart [Mon, 5 Nov 2018 12:25:31 +0000 (13:25 +0100)]
Discovery: fix double emission of finished in case of error
Olivier Goffart [Wed, 7 Nov 2018 09:49:33 +0000 (10:49 +0100)]
Discovery: Fix downloading files when database is used for local discovery
This also fix the currently failling LockedFilesTest
Olivier Goffart [Wed, 7 Nov 2018 09:32:27 +0000 (10:32 +0100)]
Remove csync.cpp: It's only dead code
Christian Kamm [Tue, 6 Nov 2018 09:59:28 +0000 (10:59 +0100)]
Add Ctrl-L as log window shortcut
F12 is taken on OSX and there's no other way of showing it.
Christian Kamm [Mon, 5 Nov 2018 11:12:49 +0000 (12:12 +0100)]
Test: Add test for locked file tracking and propagation
Christian Kamm [Thu, 1 Nov 2018 11:25:12 +0000 (12:25 +0100)]
Folder: Treat file unlock similar to external change #6822
For consistent handling of incoming notifications.
Christian Kamm [Mon, 8 Oct 2018 10:36:43 +0000 (12:36 +0200)]
Propagator: Add assert against duplicate done() calls
Olivier Goffart [Mon, 5 Nov 2018 11:03:39 +0000 (12:03 +0100)]
RemoteDiscoveryTest: Fix after the merge from 2.5
The new discovery's message is slightly different
Christian Kamm [Thu, 1 Nov 2018 11:13:16 +0000 (12:13 +0100)]
Test: Check for folder in error message #6826
Markus Goetz [Wed, 31 Oct 2018 18:31:01 +0000 (19:31 +0100)]
gitignore: XCode userdata
Olivier Goffart [Fri, 2 Nov 2018 15:46:38 +0000 (16:46 +0100)]
Discovery: Fix renaming on windows
buf.type is ItemFileSkip because csync_vio_local_stat does not set this field
Olivier Goffart [Thu, 1 Nov 2018 10:02:54 +0000 (11:02 +0100)]
New Discovery: Fix trailing slash causing failure on windows
Olivier Goffart [Wed, 31 Oct 2018 15:34:23 +0000 (16:34 +0100)]
Folder: update the folder version
Since the new index would crash old version of the client, we need to
upgrade folder version so they do not load in the client 2.5.0
Christian Kamm [Mon, 29 Oct 2018 11:31:39 +0000 (12:31 +0100)]
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.
Olivier Goffart [Mon, 29 Oct 2018 10:38:54 +0000 (11:38 +0100)]
owncloudcmd: Read the server version from the capabilities
Issue: #6846
Olivier Goffart [Wed, 24 Oct 2018 08:44:56 +0000 (10:44 +0200)]
owncloudcmd: fetch the dav user
This is required to get the new endpoint working when the server
uses ldap or that the dav user is not the same as the login.
Issue #6830
Olivier Goffart [Wed, 24 Oct 2018 10:47:41 +0000 (12:47 +0200)]
Sharing: add the `shareWithAdditionalInfo` string in autocompletion results
Issue #6749
Olivier Goffart [Wed, 24 Oct 2018 13:42:42 +0000 (15:42 +0200)]
Migration from 2.4: fallback to move file by file if directory move failled (#6807)
Migration from 2.4: fallback to move file by file if directory move failed
This can happen if the directory already exist because, say, it was
created by the ownCloud outlook plugin which save its file in the same directory
Olivier Goffart [Wed, 24 Oct 2018 08:28:26 +0000 (10:28 +0200)]
Move: Fix too many starting slashes in the destination header
QDir::cleanPath does not remove starting slashes on windows.
So use account::davUrl which is already cleaned
Issue: #6824
Olivier Goffart [Wed, 24 Oct 2018 09:57:08 +0000 (11:57 +0200)]
Wizard: Reset the QSslConfiguration before checking the server
Because a previous call with another demain might have set some
config for another server.
Issue #6832
Olivier Goffart [Sat, 20 Oct 2018 13:13:23 +0000 (15:13 +0200)]
Fix compiler warning
Olivier Goffart [Wed, 17 Oct 2018 12:49:00 +0000 (14:49 +0200)]
OAuth2: Refresh the token without aborting the sync
OAuth2 access token typically only has a token valid for 1 hour.
Before this patch, when the token was timing out during the sync, the
sync was aborted, and the ConnectionValidator was then requesting a new
token, so the sync can be started over.
If the discovery takes longer than the oauth2 validity, this means that
the sync can never proceed, as it would be always restarted from scratch.
With this patch, we try to transparently renew the OAuth2 token and restart
the jobs that failed because the access token was invalid.
Note that some changes were required in the GETFile job because it handled
the error itself and so it was erroring the jobs before its too late.
Issue #6814
Olivier Goffart [Wed, 17 Oct 2018 09:25:54 +0000 (11:25 +0200)]
HttpCredentials: initialize all member inline
Dominik Schmidt [Tue, 16 Oct 2018 17:18:01 +0000 (10:18 -0700)]
Disable autostartCheckBox if autostart is configured system wide
Christian Kamm [Fri, 19 Oct 2018 12:40:39 +0000 (14:40 +0200)]
Discovery: Virtual file handling adjustments
- adjust virtual file path handing
- helpers for vfs suffix adding/removal
- helpers for isDirectory/isVirtual on SyncJournalRecords
- be clear about what PathTuple _local/_server mean
Olivier Goffart [Sat, 20 Oct 2018 11:24:31 +0000 (13:24 +0200)]
Database: Add an index on the parent path
So we can quickly query the items in a parent directory
This uses a custom slite3 function, which means that when downgrading the client,
or using another tool to add entries in the database, any insertion in the metadata
table will produce an error: "unknown function: parent_hash()"
(This will crash the client 2.5)
Olivier Goffart [Sat, 20 Oct 2018 11:25:22 +0000 (13:25 +0200)]
Add missing export
Christian Kamm [Fri, 19 Oct 2018 09:23:50 +0000 (11:23 +0200)]
Discovery: Fix log output for instructions