Commit Graph

1572 Commits

Author SHA1 Message Date
Christian Kamm
5cbf60c6f4 About: Add remark about vfs plugin that's in use #7137 2019-04-10 14:51:15 +02:00
Christian Kamm
10c60b6e7a Fix windows build 2019-04-10 08:18:49 +02:00
Christian Kamm
fcf2af3be6 LogWindow: Remove output, add "go to log folder" button #6475 2019-04-09 13:15:05 +02:00
Christian Kamm
2b0f32c645 Vfs: Add 'availability', a simplified, user-facing pin state #7111
The idea is that the user's question is "is this folder's data available
offline?" and not "does this folder have AlwaysLocal pin state?".
The the answers to the two questions can differ: an always-local
folder can have subitems that are not always-local and are dehydrated.

The new availability enum intends to describe the answer to the user's
actual question and can be derived from pin states. If pin states aren't
stored in the database the way of calculating availability will depend
on the vfs plugin.
2019-04-09 12:52:30 +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
f7d4b29df9 PropagateDirectory: Set initial dir mtime to server mtime #7119
It's still not synced in any way later.
2019-04-09 10:10:41 +02:00
Christian Kamm
31c699be26 PropagateDirectory: Remove dead code
1. The _firstJob is usually deleted by the time the PropagateDirectory
   finishes. (deleteLater() is called early)
2. The PropagateDirectory::_item and PropagateRemoteMkdir::_item point
   to the same SyncFileItem anyway. This code is a leftover from when
   each job had its own instance.
2019-04-09 10:10:41 +02:00
Christian Kamm
ca003823d5 Detect missing server data during discovery #7112
This has two positive effects:
- We can put the error on the particular file that has missing data
- We can sync all other files
2019-04-09 10:09:56 +02:00
Christian Kamm
83c30f7dc7 Vfs: Better handling and more tests for suffix file renames
Previously removing the vfs suffix of a file always triggered a
conflict. Now it may just cause a file download.

This was done because users expected symmetry in the rename actions and
renaming foo -> foo.owncloud already triggers the "make the file
virtual" action. Now foo.owncloud -> foo triggers the "download the
contents" action.
2019-04-09 10:09:34 +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
9c34e07d10 Vfs suffix: Require suffix when creating placeholder files 2019-03-29 09:43:43 +01: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
e801016194 Local discovery tracking: On success, also wipe _renameTarget
It's possible that the rename target was in the local discovery list.
2019-03-28 17:30:19 +01:00
Christian Kamm
ca7b4be189 Fix and test _file and _renameTarget
There was a bunch of inconsistency around whether _file was set to
_renameTarget or not. This is now never done, passing on more
information.
2019-03-28 17:30:19 +01:00
Christian Kamm
b181740b30 VFS: Unbreak behavior for rename+hydrate #7001
Users can rename a file *and* add/remove the vfs suffix at the same time
leading to very complex sync actions. This patch doesn't add support for
them, but adds tests and makes sure these cases do not cause unintened
behavior.

The rename will be propagated, but the users's hydrate/dehydrate request
will be ignored.
2019-03-21 11:13:16 +01:00
Olivier Goffart
269a7b642f Async Poll: keep the size in the database
This was not required with 2.5 because a size of 0 was ignorted when comparing
size by the csync updater, to be compatible with very old version of the database.
But the we discovery will still think the file is changed if the database contains
a size of 0
2019-03-20 12:30:35 +01:00
Olivier Goffart
3093ef55d2 Upload: asynchronious operations
Implements https://github.com/owncloud/core/pull/31851
2019-03-20 12:30:35 +01:00
Markus Goetz
626ea031ec macOS: Fix vfs suffix plugin paths #7090 2019-03-16 13:53:48 +01:00
Christian Kamm
db866afb60 Merge remote-tracking branch 'origin/2.5' 2019-03-14 08:34:19 +01:00
Christian Kamm
d46f2fbd85 Client certs: Store pkcs12 in config, password in keychain
It still reads and writes the old format too, but all newly stored
client certs will be in the new form.

For #6776 because Windows limits credential data to 512 bytes in older
versions.
2019-03-14 08:18:12 +01:00
Christian Kamm
7d34d3bc76 Add PLUGINDIR cmake setting and define #7027
By default, plugins are only searched next to the binary or next to the
other Qt plugins. This optional build variable allows another path to be
configured.

The idea is that on linux the oC packaging probably wants the binary in
something like /opt/owncloud/bin and the plugins in
/opt/owncloud/lib/plugins.

Similarly, distribution packagers probably don't want the plugins next
to the binary or next to the other Qt plugins. This flag allows them to
configure another path that the executable will look in.
2019-03-14 08:11:47 +01:00
Christian Kamm
f3ab584304 Shares: "copy link" action can create shares with expiry #7061
Previously it gave up if "expiry required" was enabled. Now it'll create
a link share per day with the default expiry for these setups.
2019-03-07 10:16:07 +01:00
Olivier Goffart
6b467acf38 Download: Remove useless code and add a test
From issue #7015, the code is wrong because the path is the file system path and
not the path on the DB.
But since this is a conflict, this means the reconcile will still want to download
the file from the server next sync, so we need not to worry about this case
2019-03-05 09:17:47 +01:00
Christian Kamm
221b8680e4 Merge remote-tracking branch 'origin/2.5' 2019-03-04 09:36:29 +01:00
Christian Kamm
3d18e52017 Discovery win: Fix detection of case-only renames
Previously they were detected as DELETE+NEW because if "a" is renamed to
"A" then QFile::exists("a") will still return true on Windows.
2019-02-28 08:43:41 +01:00
Christian Kamm
9e66347be0 Disable HTTP2 by default
Due to QTBUG-73947 and #7020.

Use OWNCLOUD_HTTP2_ENABLED=1 to enable anyway.
2019-02-28 06:59:35 +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
89753773e3 Fix warnings about signedness
Sizes are always qint64, not unsigned.
TransferIds are always uint.
2019-02-14 10:53:33 +01:00
Christian Kamm
f786ef1430 Vfs: Improve sync protocol entries for actions
Creating a new virtual file and replacing a file with a virtual one now
have their own text in the protocol, not just "Downloaded".

To do this, the SyncFileItem type is kept as
ItemTypeVirtualFileDehydration for these actions. Added new code to
ensure the type isn't written to the database.

While looking at this, I've also added documentation on SyncFileItem's
_file, _renameTarget, _originalFile and destination() because some of
the semantics weren't clear.
2019-02-11 13:35:14 +01:00
Christian Kamm
9b7eba0174 Vfs: Make dehydration a SYNC and not a NEW action
That change will be useful for the notifications. Previously the
dehydrated files were reported as "newly downloaded", now they're
reported as "updated".
2019-02-11 13:35:14 +01:00
Christian Kamm
8e055b8a2c PropagateDownload: Create conflict even if local file changed
Fixes a bug introduced while moving the attribute propagation before the
conflict-renaming.
2019-02-11 13:35:14 +01:00
Christian Kamm
30d7157eb8 Vfs suffix: Fix dehydration creating the wrong db entry 2019-02-11 13:35:14 +01:00
Christian Kamm
8d1007efc5 Vfs: Remove VfsDefaults
That just complicated things. It's ok if Vfs is not a fully abstract
interface class.

The pinstate-in-db methods are instead provided directly on Vfs and
VfsSuffix and VfsOff use them to implement pin states.

The start() method is simply non-virtual and calls into startImpl() for
the plugin-specific startup code.
2019-02-11 13:35:14 +01:00
Christian Kamm
f311cc2ffb Vfs: Add option to hide socketapi pin actions
Because some plugins provide alternative ui.
2019-02-11 13:35:14 +01:00
Christian Kamm
5e53f418c5 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.
2019-02-11 13:35:14 +01:00
Christian Kamm
53a6d94410 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.
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
b80224c5ed Vfs: Enable propagating attributes on download 2019-02-11 13:35:14 +01:00
Christian Kamm
e1330fb7fe 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.
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
5680950f8d Vfs: Clarify SyncEngine::wipeVirtualFiles()
Possibly the behavior should actually change and the function should
de-placeholder all items, not just dehydrated ones.
2019-02-11 13:35:14 +01:00
Christian Kamm
02f0e18913 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.
2019-02-11 13:35:14 +01:00
Christian Kamm
e0200fbbd2 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.
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
06b4437527 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.
2019-02-11 13:35:14 +01:00
Christian Kamm
f8621f3beb 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.
2019-02-11 13:35:14 +01:00
Christian Kamm
e03df74965 Move SyncFileStatus to libcommon
It'll be needed in vfs plugins so they can connect to the data coming
out of SyncFileStatusTracker.
2019-02-11 13:35:14 +01:00
Christian Kamm
0ed8d32ddb 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.
2019-02-10 10:41:01 +01:00
Olivier Goffart
597acba274 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	VERSION.cmake
	src/common/syncjournaldb.cpp
	src/libsync/propagatedownload.cpp
2019-02-08 12:48:31 +01:00
Markus Goetz
c35d486a51 Download: Fix compile for older Qt (2) 2019-02-05 14:27:19 +01:00