Commit Graph

1583 Commits

Author SHA1 Message Date
Christian Kamm
dbae6bf224 SocketAPI: Add "show versions" to shell context menu #7196
The new menu entry depends on the privateLinksDetailsParam
capability of the server.
2019-06-04 12:26:15 +02:00
Christian Kamm
87cd1c38be Merge remote-tracking branch 'origin/2.5' into 2.6 2019-05-13 07:51:54 +02:00
Christian Kamm
87a6e039a7 Chunked upload: Fix percent encoding in If header #7176 2019-05-07 10:09:18 +02:00
Christian Kamm
f2f42d61d7 LogWindow: Option to disable automatic deletion #7154 2019-05-07 07:27:12 +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
7940f6c21d Vfs: Distinguish availability error kinds #7143
Previously "no-availability" meant db-error and querying the
availability of a nonexistant path returned AllHydrated.

Now, the availability has a DbError and a NoSuchItem error case.
2019-04-26 13:50:36 +02:00
Christian Kamm
2a900901d3 SyncEngine: Don't close db when done #7141
The db-close operation is likely a leftover from when the SyncEngine
owned its own db connection and serves no purpose anymore.

Closing the db causes the removal of the temporary wal and shm files.
These files are recreated when the db is opened again, which happens
almost immediately.

This is a problem for winvfs because the delete-recreate step wipes the
exclusion state on these files just after the sync is done. That meant
that the db temporaries permanently had a "needs sync" icon marker shown
in the explorer.

Avoiding reopening the db also reduces the number of log messages per
sync.
2019-04-16 13:41:24 +02:00
Christian Kamm
699582e533 Discovery: Improvements to doc comments 2019-04-12 13:56:29 +02:00
Christian Kamm
6a7b138aa6 Discovery: Query data-fingerprint on root item
Previously the property wasn't queried, meaning the fingerprint logic
couldn't get triggered.
2019-04-12 12:18:02 +02:00
Christian Kamm
440c06c54a Discovery: 403 and 503 on root cause error
Previously these result codes during remote discovery of the sync root
would not cause an error and the discovery would get stuck.

Also extends RemoteDiscovery tests to check for errors on the root item.
2019-04-11 13:48:56 +02:00
Christian Kamm
702a494cbb PropagateIgnore: Default to NormalError for INSTRUCTION_ERROR
Previously if one set the instruction to ERROR while forgetting to set
an error status, it'd propagate as FileIgnored. Now the default is
NormalError for INSTRUCTION_ERROR and FileIgnored for
INSTRUCTION_IGNORE.
2019-04-11 13:48:56 +02:00
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