1
0
Fork 0
Commit Graph

385 Commits

Author SHA1 Message Date
Matthieu Gallien c194605c35 implement bulk upload
add PutMultiFileJob to send many files at once

use it in BulkPropagatorJob to implement bulk upload feature

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-24 16:17:47 +01:00
Felix Weilbach 650578ee64 Don't convert exclude file to placeholder file
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-11-04 18:18:50 +01:00
Matthieu Gallien 9658aea963 on switch to VFS real plugin, convert existing files to placeholders
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-04 15:02:27 +01:00
alex-z c52718c104 Replace deprecated QRegExp with QRegularExpression.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2021-11-02 08:54:06 +00:00
Camila c6e629c30d
Give the user a more descriptive error message when syncing is aborted.
Signed-off-by: Camila <hello@camila.codes>
2021-10-18 09:50:02 +02:00
Felix Weilbach a663d235ef Add .sync-exclude.lst to exclude files
Previously the .sync-exclude.lst file of the sync root directory was
not added to the exclude files, because the current logic did only
recognize .sync-exclude.lst files when their containing directory was
discovered during the discovery phase. Therefore the sync root
.sync-exclude.lst file was never discovered. See also
ExcludedFiles::traversalPatternMatch().

Fix: #3830, #2728

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-10-14 14:02:29 +00:00
alex-z 6cafcc1124 Remove Temporary solution for file restoration issue due to failing to set the data-fingerprint.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2021-09-30 08:39:47 +00:00
Felix Weilbach 93f590c6de Replace deprecated use of QProcess::execute()
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-09-08 08:54:00 +00:00
Hannah von Reth 4b0122093a Add socket command to upload a selection of files based on a regex
(cherry picked from commit 0ded3a56a9f3470a951b18eaa9d3c1b5e8db1135)
2021-08-23 09:44:34 +02:00
Hannah von Reth 5b457a1663 Use byte array for etag 2021-08-23 09:44:33 +02:00
Hannah von Reth cb57d8e54c Add missing Q_EMIT 2021-08-23 09:40:27 +02:00
allexzander a3d12a616b Add error message to GUI.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-06-15 14:33:45 +03:00
Felix Weilbach 78f1943d76 Add a key value store to the sync journal
This key value store should help to keep track of important events,
that can not be store in the logs, because the logs are deleted too fast.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-05-19 09:04:43 +02:00
allexzander bc919bcc8c Temporary solution for file restoration issue due to failing the dataFingerprint on client.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-14 06:42:48 +00:00
allexzander 4d66d209bc Fix incorrect logger output for non-latin strings.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-02-16 09:30:08 +02:00
rakekniven c3403b83ef Removed blank before colon
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2021-01-25 08:08:13 +00:00
allexzander 4ed7feab2b Implement nested items removal when removing root encrypted folder.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-11 21:12:58 +02:00
Hannah von Reth 09cc988026
Fix a possible crash with the remove all files dialog 2020-12-30 16:20:43 +01:00
Hannah von Reth aadda32633
Handle errors in convertToPlaceholder 2020-12-30 16:17:47 +01:00
Kevin Ottens c57eff6fd8
Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Hannah von Reth 9d9eadba8e
Use time the request was send,..
not when it was processed by the client, to determine the quality of the connection.
2020-12-15 11:01:08 +01:00
Hannah von Reth 440b31986a
Ensure the callback is triggered 2020-12-15 10:59:25 +01:00
Hannah von Reth f6faba48e2
Don`t block main thread when displaying all files removed dialog
Fixes: #8170
2020-12-15 10:59:25 +01:00
Kevin Ottens d22046d679
No need to fetch encryption data separately before discovery
This step isn't necessary anymore, no one looks at ClientSideEncryption
for that information anyway.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Hannah von Reth 93152761a1
Use verbose function names instead of direct member access 2020-12-15 10:59:20 +01:00
Hannah von Reth 4d615c31da
Rename csync_instructions_e -> SyncInsturctions 2020-12-15 10:59:10 +01:00
Olivier Goffart 1c10fceacc
SyncEngine: no need to use QAtomicInt
This was done because the propagator jobs where running in a thread a long
time ago, but this is no longer the case.

(Also QAtomicInt::load is marked as deprecated now)
2020-12-15 10:59:05 +01:00
Olivier Goffart 0e7c56e81c
Don't show the "All files deleted" popup when unselecting everything with selective sync
Issue #7337
2020-12-15 10:59:04 +01:00
Olivier Goffart 66f7b27121
VFS: Do not overwrite existing files by placeholder
For issue #7557 and #7556

Note: this change the API of the VFS plugin, so the VFS plugin needs small
adaptations
2020-12-15 10:59:03 +01:00
Olivier Goffart 115a53134c
SyncEngine: Save a bit of memory by not keeping a set of all filename
This is only used for conflict files, so only save conflict files.
(The _seenFile was used for other things in 2.5, but not anymore)
2020-12-15 10:59:01 +01:00
Markus Goetz 09a0dbbf82
Reconcile: Sort already during discovery #7445 2020-12-15 10:58:59 +01:00
Christian Kamm 28797baa39
Discovery: If a move is forbidden, restore the source
Previously the source was deleted (or attempted to be deleted), even if
the new location was not acceptable for upload. This could make data
unavilable on the server.

For #7410
2020-12-15 10:58:58 +01:00
Christian Kamm 5761f4cd8a
SyncEngine: Don't duplicate fatal errors
Previously fatal error texts were duplicated: Once they entered the
SyncResult via the SyncFileItem and once via syncError().

syncError is intended for folder-wide sync issues that are not pinned
to particular files. Thus that duplicated path is removed.

For #5088
2020-12-15 10:58:54 +01:00
Christian Kamm 0df3b83bd2
Vfs: Add hook to allow update-metadata for unchanged files
Allows winvfs to convert files to placeholders when vfs is enabled. This
is required to mark files as in-sync #7329.
2020-12-15 10:58:53 +01:00
Christian Kamm 5acb157a7e
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.
2020-12-15 10:58:52 +01:00
Olivier Goffart 9f08636a4a
SyncEngine: Fix renaming a single file cause the "delete all file" popup
Possibly a regression, since the new discovery discovers rist the renamed
files as removed

Issue #7204
2020-12-15 10:58:51 +01:00
Christian Kamm edad7ce7d7
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.
2020-12-15 10:58:50 +01:00
Christian Kamm 21cb93e3ce
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.
2020-12-15 10:58:48 +01:00
Christian Kamm 7b96321df2
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.
2020-12-15 10:58:47 +01:00
Christian Kamm 238ac53666
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.
2020-12-15 10:58:41 +01:00
Christian Kamm 4c04351360
Fix warnings about signedness
Sizes are always qint64, not unsigned.
TransferIds are always uint.
2020-12-15 10:58:41 +01:00
Christian Kamm 7f400e3226
Pin state updates
- unspecified and inherited are different
- move enum to header in common/
- access through Vfs instead of directly in Journal
2020-12-15 10:58:38 +01:00
Christian Kamm f89450648f
Vfs: Clarify SyncEngine::wipeVirtualFiles()
Possibly the behavior should actually change and the function should
de-placeholder all items, not just dehydrated ones.
2020-12-15 10:58:38 +01:00
Christian Kamm af1666788e
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.
2020-12-15 10:58:37 +01:00
Christian Kamm 31394f14b5
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.
2020-12-15 10:58:37 +01:00
Christian Kamm fe27804afb
Move SyncFileStatus to libcommon
It'll be needed in vfs plugins so they can connect to the data coming
out of SyncFileStatusTracker.
2020-12-15 10:58:37 +01:00
Christian Kamm 4d58208676
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.
2020-12-15 10:58:36 +01:00
Christian Kamm b91839b760
SyncEngine: Rename phase finishing slots
slotDiscoveryJobFinished -> slotDiscoveryFinished
slotFinished -> slotPropagationFinished

This should be clearer. Particular the
slotFinished -> finalize -> emit finished()
chain was confusing before.
2020-12-15 10:58:34 +01:00
Christian Kamm 9f8505c736
Discovery: Fix aborting during discovery #6972 2020-12-15 10:58:34 +01:00
Christian Kamm e774c6c739
Discovery: Ensure selective sync lists are sorted #6958 2020-12-15 10:58:34 +01:00