Christian Kamm [Tue, 5 Feb 2019 10:42:15 +0000 (11:42 +0100)]
PropagateDownload: Conflict-rename later
The block of code that propagated attributes etc from the previously
existing file was placed *after* the block that renamed the previously
existing file to a conflict name. That meant the propagation didn't work
in the conflict case.
Christian Kamm [Fri, 1 Feb 2019 10:23:00 +0000 (11:23 +0100)]
Vfs: dehydration is separate action
Allows for better attribute preservation.
Also add verifyFileUnchanged() call before dehydration to avoid data
loss when discovery takes a while.
Christian Kamm [Tue, 29 Jan 2019 10:41:03 +0000 (11:41 +0100)]
File watcher: Pin state attribute changes are valid notifications
Previously they would be discarded since the file's mtime or size hadn't
changed.
Christian Kamm [Tue, 29 Jan 2019 09:53:47 +0000 (10:53 +0100)]
PinStates cleanup
- SyncJournalDB functions now behind internalPinStates() to avoid
accidental usage, when nearly everyone should go through Vfs.
- Rename Vfs::getPinState() to Vfs::pinState()
Christian Kamm [Fri, 25 Jan 2019 06:46:16 +0000 (07:46 +0100)]
Folder: Add remoteFolderTrailingSlash()
There were cases where the "/" exception wasn't handled correctly
and there'd be extra slashes in generated paths.
Christian Kamm [Fri, 25 Jan 2019 12:16:32 +0000 (13:16 +0100)]
Vfs: Call unregisterFolder() when folder is removed
Christian Kamm [Fri, 25 Jan 2019 10:11:28 +0000 (11:11 +0100)]
Vfs: Enable propagating attributes on download
Christian Kamm [Fri, 25 Jan 2019 10:09:50 +0000 (11:09 +0100)]
SyncFileStatusTracker: Distinguish Warning and Excluded
Any folder with a (potentially deeply) contained error will have
StatusWarning. StatusExcluded marks exclusions. The difference is useful
to know for VFS.
Christian Kamm [Wed, 23 Jan 2019 14:12:02 +0000 (15:12 +0100)]
Pin state updates
- unspecified and inherited are different
- move enum to header in common/
- access through Vfs instead of directly in Journal
Christian Kamm [Wed, 23 Jan 2019 12:07:56 +0000 (13:07 +0100)]
Vfs: Shell integration is enabled optionally
Needs to be disabled for tests in some cases.
Christian Kamm [Wed, 23 Jan 2019 11:58:14 +0000 (12:58 +0100)]
Vfs: Clarify SyncEngine::wipeVirtualFiles()
Possibly the behavior should actually change and the function should
de-placeholder all items, not just dehydrated ones.
Christian Kamm [Tue, 22 Jan 2019 12:32:28 +0000 (13:32 +0100)]
Discovery: Files can have dehydrate/download actions
This will be used in conjunction with vfs plugins that detect whether a
file has a pending hydration/dehydration through independent means and
communicate that to the discovery through local file type.
Christian Kamm [Tue, 22 Jan 2019 10:29:03 +0000 (11:29 +0100)]
Discovery: Add signal for silentlyExcluded files
This allows SyncFileStatusTracker to also know about these. After all
its information is used to provide icons for them too.
Christian Kamm [Mon, 21 Jan 2019 10:24:16 +0000 (11:24 +0100)]
Vfs: Send SyncFileStatusTracker data to vfs plugins
Christian Kamm [Mon, 21 Jan 2019 10:22:40 +0000 (11:22 +0100)]
Vfs: Make files that end up in db placeholders
Since 'placeholder' just means that it's an item of the special type
that the vfs plugin can deal with - no matter whether hydrated or
dehydrated - all done items should become placeholders. Even
directories.
Now every file that passes through updateMetadata() will be converted to
a placeholder if necessary.
Christian Kamm [Mon, 21 Jan 2019 10:19:45 +0000 (11:19 +0100)]
Propagator: Helper for updating db
Similar steps were done in many propagation jobs.
This also updates the db entry to always have the item.destination() as
file path.
Christian Kamm [Mon, 21 Jan 2019 10:13:17 +0000 (11:13 +0100)]
Move SyncFileStatus to libcommon
It'll be needed in vfs plugins so they can connect to the data coming
out of SyncFileStatusTracker.
Christian Kamm [Tue, 15 Jan 2019 13:54:30 +0000 (14:54 +0100)]
Build fix for mingw64 7.3 (Qt 5.12.0)
Christian Kamm [Fri, 8 Feb 2019 08:57:11 +0000 (09:57 +0100)]
File watcher: Reduce touch ignore duration
On Linux and Windows the file watcher can't distinguish between changes
that were caused by the process itself, like during a sync operation,
and external changes. To work around that the client keeps a list of
files it has touched and blocks notifications on these files for a bit.
The duration of this block was originally and arbitrarily set at 15
seconds. During manual tests I regularly thought there was a bug when
syncs didn't trigger, when the only problem was that my changes happened
too close to a previous sync operation.
This change reduces the duration to three seconds. I imagine that this
is still enough.
Also use std::chrono while at it.
Dominik Schmidt [Thu, 6 Dec 2018 11:03:59 +0000 (12:03 +0100)]
Switch to standard opt-out BUILD_TESTING instead of opt-in UNIT_TESTING
Compare https://cmake.org/cmake/help/v3.0/module/CTest.html
Craft automatically handles BUILD_TESTING, so we don't need to handle it
in our own blueprint.
Christian Kamm [Tue, 22 Jan 2019 09:04:08 +0000 (10:04 +0100)]
HttpCreds: Warn in log if keychain-write jobs fail #6776
Also, calling deleteLater() on jobs is unnecessary (they autodelete
after finished()) and deleting the attached QSettings is also
unnecessary because the settings object is parented to the job.
Christian Kamm [Wed, 30 Jan 2019 04:43:08 +0000 (05:43 +0100)]
Download: Ignore content-length for compressed HTTP2/SPDY replies #6885
It contains the compressed size.
See https://bugreports.qt.io/browse/QTBUG-73364
Christian Kamm [Thu, 17 Jan 2019 09:21:22 +0000 (10:21 +0100)]
SocketAPI: Remove listener immediately on lost connection
To avoid situations where messages are attempted to be sent to dead
connections.
Christian Kamm [Thu, 17 Jan 2019 09:16:44 +0000 (10:16 +0100)]
SocketAPI OSX: Forbid further sends on connectionDidDie
Also release the remote end immediately.
Olivier Goffart [Fri, 18 Jan 2019 11:27:46 +0000 (12:27 +0100)]
Move: Fix move detection in directory move on the other side
Olivier Goffart [Fri, 18 Jan 2019 10:59:12 +0000 (11:59 +0100)]
Move: add comments and tests
Olivier Goffart [Sun, 23 Dec 2018 10:30:02 +0000 (11:30 +0100)]
Move: add more test and fix move within moves
Olivier Goffart [Sun, 23 Dec 2018 09:19:20 +0000 (10:19 +0100)]
Rename: fix renamed folder moved into renamed folder issue
Issue #6694
Christian Kamm [Tue, 15 Jan 2019 09:52:44 +0000 (10:52 +0100)]
vfs: Update pinning context menu to be less confusing
Seeing "Currently available online only" for a currently hydrated file
was odd. It makes sense since current hydration status and pin state are
independent.
The new text will say something like "Currently available, but marked
online only" to better indicate that the file might be dehydrated later
since it wasn't pinned.
Christian Kamm [Mon, 14 Jan 2019 14:48:08 +0000 (15:48 +0100)]
Vfs: Switch on/off only when sync isn't running #6936
Avoids some situations that might cause data loss.
Christian Kamm [Mon, 14 Jan 2019 14:46:40 +0000 (15:46 +0100)]
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
Christian Kamm [Mon, 14 Jan 2019 14:44:50 +0000 (15:44 +0100)]
SyncEngine: Rename phase finishing slots
slotDiscoveryJobFinished -> slotDiscoveryFinished
slotFinished -> slotPropagationFinished
This should be clearer. Particular the
slotFinished -> finalize -> emit finished()
chain was confusing before.
Christian Kamm [Mon, 14 Jan 2019 14:41:34 +0000 (15:41 +0100)]
Discovery: Fix aborting during discovery #6972
Christian Kamm [Thu, 10 Jan 2019 12:26:26 +0000 (13:26 +0100)]
vfs suffix: Ignore server files or synced files with the suffix #6953
Christian Kamm [Thu, 10 Jan 2019 09:19:27 +0000 (10:19 +0100)]
Discovery: Ensure selective sync lists are sorted #6958
Christian Kamm [Thu, 26 Nov 2020 23:57:49 +0000 (00:57 +0100)]
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.
Christian Kamm [Tue, 8 Jan 2019 14:15:17 +0000 (15:15 +0100)]
vfs: Allow retrieving of pin state paths and flags
Christian Kamm [Tue, 8 Jan 2019 13:55:30 +0000 (14:55 +0100)]
Result: Add copy/move ctor/op=
It has a destructor and these operations make sense. Particularly the
move is important for code like:
Result<x, y> foo() { Result<x, y> v; return v; }
because the move-ctor will not autogenerate if x or y are not trivially
destructible.
Christian Kamm [Tue, 8 Jan 2019 12:10:20 +0000 (13:10 +0100)]
vfs: Change per-folder message on vfs support
I'm unsure this note is all that useful. Remove entirely?
Christian Kamm [Tue, 8 Jan 2019 11:24:15 +0000 (12:24 +0100)]
vfs: Allow (de-)hydrating the full sync folder
Christian Kamm [Tue, 8 Jan 2019 08:28:40 +0000 (09:28 +0100)]
vfs: Don't assume suffix mode for old folders
That would break with old folders that use selective sync.
Christian Kamm [Tue, 8 Jan 2019 08:14:38 +0000 (09:14 +0100)]
vfs: Disable selective sync if vfs support is available
Christian Kamm [Fri, 11 Jan 2019 12:14:30 +0000 (13:14 +0100)]
Wizard: Ensure client cert doesn't get lost #6911
Christian Kamm [Fri, 11 Jan 2019 11:54:33 +0000 (12:54 +0100)]
Wizard: Drop unused function
Markus Goetz [Fri, 11 Jan 2019 10:26:22 +0000 (11:26 +0100)]
Sync: Display theme in debug log
Christian Kamm [Thu, 10 Jan 2019 08:21:48 +0000 (09:21 +0100)]
sqlite: Set exclusive locking_mode to avoid WAL issues #6881
Can be overridden with OWNCLOUD_SQLITE_LOCKING_MODE
Dominik Schmidt [Wed, 9 Jan 2019 15:00:33 +0000 (16:00 +0100)]
Fix lookup of system wide settings
Olivier Goffart [Tue, 18 Dec 2018 11:18:43 +0000 (12:18 +0100)]
sqlite: Update bundled version to 3.26.0
For OS X and Windows.
Olivier Goffart [Thu, 29 Nov 2018 11:40:00 +0000 (12:40 +0100)]
HttpCredentials: Do not re-enter the event loop
https://sentry.io/owncloud/desktop-win-and-mac/issues/
777907931/
mention a crash in OCC::HttpCredentialsGui::showDialog
One possible explaination is that this is caused by re-entring the event loop.
So don't do that.
Olivier Goffart [Thu, 29 Nov 2018 22:17:34 +0000 (23:17 +0100)]
Chunking Move: Fix too many starting slashes in the destination header
Commit
6ca724f fixed it for the move case. But the upload MOVE did the same
Issue #6904
Olivier Goffart [Thu, 29 Nov 2018 12:55:27 +0000 (13:55 +0100)]
Gui: do not show the settings when opening a virtual file
Issue #6764
Christian Kamm [Thu, 26 Nov 2020 22:06:03 +0000 (23:06 +0100)]
SocketAPI: Overhaul ui for 'available locally' vs 'online only'
For #6815
Christian Kamm [Fri, 21 Dec 2018 09:35:07 +0000 (10:35 +0100)]
Db: Add wiping of pin state for subtrees
Christian Kamm [Thu, 20 Dec 2018 10:24:41 +0000 (11:24 +0100)]
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.
Olivier Goffart [Thu, 29 Nov 2018 16:00:16 +0000 (17:00 +0100)]
Discovery: Handle the blacklistFiles from the server capabilities
Issue #434
Ideally one could add the blacklist to the exlucde reggexp, but this
is simpler
Christian Kamm [Thu, 20 Dec 2018 08:45:31 +0000 (09:45 +0100)]
Progress: Virtual file creation needs no transfer progress #6933
Treat virtual file creation as a size-less action, similar to
propagating renames or deletions.
Christian Kamm [Wed, 19 Dec 2018 13:51:40 +0000 (14:51 +0100)]
vfs: Show "new files are virtual" option only with vfs
If there's no vfs possibility, showing it makes little sense.
Christian Kamm [Tue, 27 Nov 2018 09:31:13 +0000 (10:31 +0100)]
vfs: SocketAPI actions adjust pin state of directories #6815
Downloading a folder also sets its pin state; releasing a folder sets
its pin state.
Christian Kamm [Tue, 27 Nov 2018 09:22:23 +0000 (10:22 +0100)]
vfs: Use PinState in sync algorithm #6815
New files are virtual if the file's pin state is OnlineOnly.
Christian Kamm [Mon, 26 Nov 2018 12:40:51 +0000 (13:40 +0100)]
vfs: Introduce PinState db storage #6815
The idea is to allow folders (and later maybe files?) to be
- pinned to be available locally
- pinned to be online only
- inherit their pin from the parent
Where this pinning only controls the default for new files.
Subfolders may have a different pin state, and contained files
may be hydrated or dehydrated based on user actions.
This value is stored in a new 'flags' table. The idea is to store
data there that doesn't necessarily exist for each metadata entry.
The selective sync state could be migrated to this table.
Olivier Goffart [Tue, 18 Dec 2018 11:08:34 +0000 (12:08 +0100)]
Move test for issue #1329 from t1.pl to new test system
Olivier Goffart [Tue, 18 Dec 2018 10:59:37 +0000 (11:59 +0100)]
Discovery: Set right direction when restoring deleted discovery because it has modified files
(Catched by a faillure of t1.pl)
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