1
0
Fork 0
Commit Graph

8010 Commits

Author SHA1 Message Date
Kevin Ottens 002abdc38b
Specify PUBLIC for the link targets to make them visible to windeployqt
I went full steam on making it all public which is not really required,
it's only really QtWebSockets we're after. Could always be fine tuned
later on if this works as expected.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-27 18:00:26 +01:00
Felix Weilbach 51d8cf8102 Start file conflict resolve dialog asynchronous
Fixes #2804

Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
2021-01-27 08:01:25 +00:00
Valdnet d8a88fd047 Replace dots with ellipses and add spaces. 2021-01-27 07:36:52 +00:00
Kevin Ottens ebfe51b7e7 Don't treat new folders in unpinned folders as files to dehydrate
This would only happen if the parent of the newly created folder would
be explicitly set to online only, hence why it went under the radar
previously.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 17:09:24 +00:00
Valdnet 817d460b84 Move space in "owncloudadvancedsetuppage.cpp" 2021-01-26 16:40:46 +00:00
Kevin Ottens d20fc1a6ce Remove unused method
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 11:20:13 +00:00
Kevin Ottens 4168c0d082 Avoid keeping Account alive via a shared ptr in ClientSideEncryption
This account object was really only used during the initialization phase
or for forgetting the sensitive data. So let's receive it as parameter
there and pass it on from job to job as needed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 11:20:13 +00:00
Kevin Ottens 21035d48a6 Don't crash when the same request is filled twice
The OS might request the same file again if we take too much time to
fulfill a request. So in case it's queueing the same one again instead
of bailing out just fail the second one and let the first one finish
properly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 10:58:14 +00:00
Kevin Ottens d3c7218ee8 Be a bit more resilient with errors
In case we'd been to slow to fullfill or we're still processing a
cancelled request better not just crash. We still log the issue though.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 10:58:14 +00:00
Valdnet f365ec1e4c Move space in "folderwizard.cpp" 2021-01-25 17:42:38 +00:00
Valdnet 8539dc7dc6 Change the quotation marks 2021-01-25 17:33:46 +00:00
Felix Weilbach 78f00acaa2 Add push notifications for file changes
Resolves #2802

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-01-25 17:01:09 +00:00
Kevin Ottens 4992bfa8ef
Ensure the right radio is selected when selective sync is picked
This got broken previously when trying to reconcile during a
cherry-pick. This also repairs the case when the theme tells us the
default is to not select anything (not that we're using this right now
but in case we'd like to brand this).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-25 16:53:21 +01:00
Kevin Ottens 2b2dac10ef
It's not really recommended anymore at least not on Windows
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-25 16:24:44 +01:00
allexzander eb80f54dcf E2EE Fix incorrect name of a nested encrypted item in the Settings dialog when the root folder is non-encrypted and it is renamed.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:54 +02:00
allexzander 483a874cb6 Fix folder upload issue due to wrong Lock/Unlock order
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:30 +02:00
allexzander 79fe231acc Fix E2EE root folder rename issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:30 +02:00
Nicolas Fella ab064c92b6 Fix build against Qt 5.15.3
Use QLatin1Char to prevent build error due to stricter QT_NO_CAST_FROM_ASCII

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-01-25 08:19:49 +00:00
rakekniven c3403b83ef Removed blank before colon
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2021-01-25 08:08:13 +00:00
Kevin Ottens 48f0c54a90 Fix the branding detection for monochrome icons on Mac
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-21 06:39:11 +00:00
Kevin Ottens 96b2b2a509 Revert "Make monochrome icons the default on Linux and Mac OS."
This reverts commit 016410dbaa.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-21 06:39:11 +00:00
Kevin Ottens 471bb25e62
Use APPLICATION_ICON_SET for themed icons
We now favor APPLICATION_ICON_SET to isBranded() regarding the decision
to use PNG or SVG for icons.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-20 15:11:57 +01:00
Kevin Ottens 88986749a4
Use the SVG wizard logo when APPLICATION_ICON_SET says so
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-20 15:09:58 +01:00
allexzander 96472320e4 Fix e2ee folder move issue
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-14 15:54:30 +02:00
Kevin Ottens 1aeb77c967
Add the XAttr backend prototype with its test suite
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:03 +01:00
Kevin Ottens 7c8b7db725
Don't detect file changes during hydration for virtual files
Indeed, that file size will almost always change between the 1 byte
placeholder and the hydrated file. Only when using the CfAPI on Windows
this won't be the case since because it will expose the original size
even for placeholders.

Also worth noting: the suffix backend didn't hit that case since the
filename changes (with suffix for placeholders, without for hydrated
files).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:03 +01:00
Kevin Ottens 6e51dcf9c6
Provide the path to the current folder to statTypeVirtualFile on unix
Otherwise backends can't get to the actual file which will be needed for
the XAttr backend.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:03 +01:00
Kevin Ottens a89b483773
Add the plumbing for a new extended attributes backend
Ideally this will end up being the backend we use for both Linux and
macOS but that will require work with desktop environments on the Linux
side and to reverse engineering at least on xattr value on macOS.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:02 +01:00
allexzander bf5b214e0e E2EE fix upload parallelism issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-14 06:59:05 +00:00
Kevin Ottens 5325e058d8
Repair chunked uploads
There's been a confusion between the chunk number and the chunk
offset leading to corruptions... Let's pass the proper offset to
the UploadDevice again.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-13 18:00:19 +01: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
Kevin Ottens 2d8eb19ee5
Second attempt at fixing CfAPI wrapper build in Win32 mode
MSVC having so useless error messages it didn't quite point to the root
cause of the issue... it turns out that through the maze of macros
defined in the windows API, there's one which impacted the function
pointer definition of CfCloseHandle which would then not convert to
FileHandle::Deleter as expected. So I end up wrapping it in a lambda to
help... luckily this kind of lambdas decay into a simple function
pointer so there's likely no overhead it's just to coerce the compiler
into doing the right thing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-07 13:49:10 +01:00
Kevin Ottens 79a54d68ed
Revert "Fix CfAPI wrapper build in Win32 mode"
This reverts commit 3b3864296a.
2021-01-07 13:40:01 +01:00
Kevin Ottens 3b3864296a
Fix CfAPI wrapper build in Win32 mode
For some reason MSVC manages to deduce the right constructor in Win64
mode but not in Win32 mode. So let's be more explicit about what we
return.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-06 17:07:50 +01:00
Felix Weilbach db0f1e245d Remove NO_SHIBBOLETH flag and dead code
Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
2021-01-05 12:58:58 +01:00
Hannah von Reth 09cc988026
Fix a possible crash with the remove all files dialog 2020-12-30 16:20:43 +01:00
Kevin Ottens da3ff631ef
Use Q_REQUIRED_RESULT directly like in other places
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 16:20:42 +01:00
Hannah von Reth 72b6118c3e
Mark vfs functions as OC_REQUIRED_RESULT 2020-12-30 16:17:48 +01:00
Hannah von Reth aadda32633
Handle errors in convertToPlaceholder 2020-12-30 16:17:47 +01:00
Hannah von Reth 552427ffc3
Update windows launch on start binary location
Fixes: #7672
2020-12-30 16:17:47 +01:00
Hannah von Reth 713a429675
Add todo for Qt 5.15 2020-12-30 16:17:47 +01:00
Hannah von Reth 1144473f5d
Cleanup pathtoUNC and its test 2020-12-30 16:17:46 +01:00
Hannah von Reth 51d73e27ea
Clarify comment 2020-12-30 16:17:46 +01:00
Hannah von Reth 3f873ed2ee
Simplify file comparison 2020-12-30 16:17:46 +01:00
Hannah von Reth 157d526129
Include auth type in http log 2020-12-30 16:17:46 +01:00
Hannah von Reth f6f7789afa
Log the final http request 2020-12-30 16:17:41 +01:00
Kevin Ottens 46a5bd6b25
Ensure we properly cancel hydration on server errors
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:59 +01:00
Kevin Ottens e37a5f36b0
Don't look at virtual files data for the mimetype matches
Otherwise this would attempt to download the file everytime we check the
direct editor for a given file which wouldn't be adequate. Would also
lead to a deadlock in our case since that would happen in the main
thread and implicit hydration is driven from there as well.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 90fbb7d322
Implement callback between wrapper and vfs object for hydration requests
This comes with a test simulating an open request coming from another
process (although in our case it's really just a thread). The actual
hydration works as expected by cfapi, handling of encrypted files is for
now missing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 7668c521c1
Split the CfAPI lower level code in a wrapper
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 423780bf79
Add initial version of the CfApi backend
For now this implements only the logic necessary to get a test suite
equivalent to the TestSyncVirtualFiles one to pass. It doesn't (yet)
honor request to fetch files from the system.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 216b251b40
One byte placeholders assumption only holds for the suffix backend
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:57 +01:00
Kevin Ottens 4d4b87c9c3
Don't consider CfApi backend as experimental
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:53 +01:00
rakekniven e1979fdb33 Removed translation for "etag" and changed spelling
Shouldn't be translated.

Just checked https://en.wikipedia.org/wiki/HTTP_ETag and all available localized pages.

Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-12-28 08:51:56 +00:00
Hannah Rittich 5fc778bfaa Fixed the autostart for AppImages. See #2504.
Signed-off-by: Hannah Rittich <hrittich@users.noreply.github.com>
2020-12-21 11:56:09 +01:00
rakekniven 29d968ab15 Changed triple dot to ellipsis
Reported at Transifex.

Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-12-21 08:00:29 +00:00
Camila 0e0ea9d81a Update the settings dialog window title.
Signed-off-by: Camila <hello@camila.codes>
2020-12-17 07:04:07 +00:00
Camila 625752f85d General settings: move buttons to the bottom left of their group boxes.
Signed-off-by: Camila <hello@camila.codes>
2020-12-17 07:04:07 +00:00
Camila 016410dbaa
Make monochrome icons the default on Linux and Mac OS.
Unless it is branded with other icons.

Signed-off-by: Camila <hello@camila.codes>
2020-12-16 14:42:24 +01:00
Kevin Ottens af57a702ef
Workaround bug in older GCC used for the AppImage toolchain
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Kevin Ottens 0756497c3e
Get the excluded files test to pass again on Windows
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +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 c03a5da670
Don't warn if everything is fine 2020-12-15 11:01:53 +01:00
Hannah von Reth 4e373ca7ff
Remove now unneeded cmake test and define 2020-12-15 11:01:52 +01:00
Hannah von Reth ebd8047cb6
Replace custome date parser QDateTime::fromString(value, Qt::RFC2822Date) 2020-12-15 11:01:52 +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 1b4ccea083
Owncloud - virtual files smaller <1KB - problems with syncing
The issue was caused by gziped responses not providing a
content lenght header.

Fixes: #8248
2020-12-15 10:59:27 +01:00
Hannah von Reth 96eaef6dba
Pause sync when remove all dialog is displayed
Fixes: #8263
2020-12-15 10:59:27 +01:00
Hannah von Reth c253b51249
Use enum instead of int 2020-12-15 10:59:27 +01:00
Hannah von Reth befc373ea6
Fix test on systems where C:\ is not writeable 2020-12-15 10:59:27 +01:00
Hannah von Reth 0eb8b01f0a
Fix usePlaceholders migration 2020-12-15 10:59:26 +01:00
Hannah von Reth a083a37126
Fix vfs experimental text 2020-12-15 10:59:26 +01:00
Hannah von Reth b2934a68bc
Fix folder permission check on NTFS
Fixes: #8187
2020-12-15 10:59:26 +01:00
Hannah von Reth 8dbdaed5c3
Fix condition 2020-12-15 10:59:26 +01:00
Hannah von Reth e4a0222954
Append .exe to crashreporter path so it is better located 2020-12-15 10:59:25 +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
Hannah von Reth b4cb3ecb5a
Don't use exec() on dialogs 2020-12-15 10:59:25 +01:00
Hannah von Reth 4878042e61
Update libcrashreporter-qt 2020-12-15 10:59:25 +01:00
Hannah von Reth 7c65d38ba4
Draw active progressbar
Pass a widget to the progressbar in the folder delegate to draw the correct active state
2020-12-15 10:59:25 +01:00
Kevin Ottens 201dbd54db
Remove the plugin loader mechanism for VFS backends
We will have all the code in public anyway so it can just be compiled
in. Thus no need to go through the plugin loading dance. Replaced the
loading with factory functions. Kept mostly the same structure
otherwise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens 7e5f81ea81
Allow to control availability of folders in the settings dialog
It felt odd to be able to control the encryption status in the settings
dialog but not the availability. Also availability was controllable on
the root, so let's make it widely available.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens 70c2dc70a1
Resurrect the display of subfolders for VFS sync folders
This got removed from the settings since in that case selective sync
isn't supported. Unfortunately that's also necessary to display them to
allow encrypting folders via the context menu.

So we display the subfolders again but in the case of VFS we disable the
ability to (un)check them. They just have an icon, a name and a context
menu.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens 9f0e0b0f6a
Update the FolderStatusModel when a folder encryption ends
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens 596bfab6e1
Set the account state after E2EE is setup in the GUI
Otherwise we would not display the E2EE message if the account was
connected before the creation of the settings dialog. This was likely
caused by the delayed creation of the settings dialog.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens f45e84f2ee
Remove empty action in the settings toolbar
This was causing an unwanted line in the middle of the bar.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens d63097475c
Fix typo and style
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 1acb2679dd
Get rid of now unused GetFolderEncryptStatusJob
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 36b8e7c2a4
Remove the encryption flag check from encrypted propagation code
If we use those encrypted propagation code paths, we already know from
the discovery phase (and thus the journal db) that the folders are
encrypted so no need to check again.

This will remove another expensive round trip with the server.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens b2533e6451
Remove encrypt status job fetching from ClientSideEncryption
This is now unused.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +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
Kevin Ottens 580b36fe20
Remove unused methods on ClientSideEncryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens ce5edfdf4d
Stop using e2e()->isFolderEncrypted() in the folder wizard
We used the same approach than for the FolderStatusModel by getting the
is-encrypted property straight from the LSCOL job.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 4fde05b8b6
FolderStatusModel now uses the LSCOL job result for encryption status
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens 8e5a8d9fb9
FolderStatusModel LSCOL job now gets the is-encrypted property
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens 7a4a359704
Stop using e2e()->isFolderEncrypted() in the jobs
Thanks to the new discovery algorithm, we got all the freshest E2EE
information straight from the database so reuse it instead of going
through an in memory copy.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens 37a51872e1
Set the encrypted flag in the database when EncryptFolderJob succeeds
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens b667bdda14
Change EncryptFolderJob path convention
It had a different path convention than all the other jobs, most likely
for legacy reasons because of the tight coupling it had to the settings
dialog.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens ee8e0fa332
Have the folder token inside the EncryptFolderJob
No need to look for a token on the outside we can just work properly by
keeping all the state encapsulated in the job.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens af00ef1cca
Don't use getFileRecordByE2eMangledName in jobs anymore
Thanks to the new discovery algorithm we got both mangled and original
file names in the item so no need to go through the database for
nothing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 66f24241d8
Repair E2EE deletions
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 567f678fd5
Make sure the encrypted flag gets all the way to the journal db
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 961794669e
Repair E2EE uploads
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 1d07af07a5
Start hooking up E2EE to the new discovery algorithm
Now we pull the encrypted metadata during the discovery which is a
better approach than before. This shall remove the need for some of the
deep propfinds we have been using so far. It already simplifies the code
a bit for the download scenario.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 2cf76bbcbf
Repair the Windows Build
We now enforce the use of QStringLiteral and friends in some places,
but that feel through the cracks for some of the Windows specific code.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Hannah von Reth dd3e70b667
VirtualFiles: Ensure the target location supports vfs
Fixes: #8131
2020-12-15 10:59:20 +01:00
Hannah von Reth 8796f25994
Log error code as hex 2020-12-15 10:59:20 +01:00
Hannah von Reth 44175aca94
Fix: Log chunked messages 2020-12-15 10:59:20 +01:00
Hannah von Reth 60011e8003
Remove vfs warning in the delegate, indicate them in the description instead
Fixes: #8139
2020-12-15 10:59:20 +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 356192fb1d
Don't show 404 errors when manually creating folder sync pair.
Fixes: #7724
2020-12-15 10:59:20 +01:00
Hannah von Reth 1619cd5dcc
Use winvfs by default when adding folder sync connection
Fixes: #8083
2020-12-15 10:59:19 +01:00
Hannah von Reth 8460526df9
Clear cookies on logout 2020-12-15 10:59:19 +01:00
Hannah von Reth f220151527
Remove the use of goto from src/csync/csync_exclude.cpp 2020-12-15 10:59:19 +01:00
Hannah von Reth 4f596dae8c
Log http status
Fixes: #8073
2020-12-15 10:59:19 +01:00
Hannah von Reth 020c6d6424
Fix placeholders are reverted to OnlineOnly
Fixes: #7779
2020-12-15 10:59:19 +01:00
Hannah von Reth d58cdaeb2a
Crashreporter: Apply the same hdpi settings as to the main gui
Fixes: #8042
2020-12-15 10:59:18 +01:00
Hannah von Reth 0eabc75039
Improve log message 2020-12-15 10:59:18 +01:00
Hannah von Reth f1f6257b5d
Windows VFS: Enable Windows VFS by default 2020-12-15 10:59:18 +01:00
Hannah von Reth 1aa1ea7bea
Return empty string instead of 1 as adler32 checksum for empty files 2020-12-15 10:59:18 +01:00
Hannah von Reth 23f7c51f70
Print checksum on mismatch 2020-12-15 10:59:18 +01:00
Hannah von Reth fd6146d09e
Clazy: Fix some warnings 2020-12-15 10:59:18 +01:00
Hannah von Reth 3caf8276a2
Remove pointless warning
We also don't have a version entry in the db if thne db is new.
As I don't expect regular updates from 1.5 this message can just be removed.

Fixes: #8004
2020-12-15 10:59:17 +01:00
Hannah von Reth 2d66025d72
csync: apply strict QString handling 2020-12-15 10:59:17 +01:00
Hannah von Reth bd62615aab
Clazy: Fix some warnigns 2020-12-15 10:59:17 +01:00
Hannah von Reth d109d49b49
Ui: Hide selective sync settings if vfs is active
Fixes: #7976
2020-12-15 10:59:17 +01:00
Hannah von Reth 54cc2be00f
Fix assertion introduced by e1ca612c5d3087e02f6b7f8e454224e0b88e82ad
[ fatal default ]:ASSERT: "last < rowCount(parent)" in file C:\_\17a9f6ae\qtbase-everywhere-src-5.12.9\src\corelib\itemmodels\qabstractitemmodel.cpp, line 2787

e1ca612c5d3087e02f6b7f8e454224e0b88e82ad stopped adding sub folders so we can return the actual size.
2020-12-15 10:59:17 +01:00
Hannah von Reth 93281c8560
Use const access where possible 2020-12-15 10:59:17 +01:00
Hannah von Reth 563b347567
csync: apply strict QString handling 2020-12-15 10:59:16 +01:00
Hannah von Reth 82dbf8b5e1
VFS: remove now unused parameter 2020-12-15 10:59:16 +01:00
Hannah von Reth c1a91e91e7
Use the servers checksum type by default 2020-12-15 10:59:16 +01:00
Hannah von Reth 8c3749cbe2
Log state before specific assertion 2020-12-15 10:59:16 +01:00
Hannah von Reth 2887a93c40
Win: Use full Windows paths in file watcher and improve logging 2020-12-15 10:59:16 +01:00
Hannah von Reth 7fa7bc54c4
Win: Move hresultToQString from vfs plugin to Utility::formatWinError 2020-12-15 10:59:16 +01:00
Hannah von Reth 4589772393
Remove more legacy C code 2020-12-15 10:59:15 +01:00
Hannah von Reth 3dcbc9fa66
Tests: Port check_vio_ext to Windows 2020-12-15 10:59:15 +01:00
Hannah von Reth 47dc7e6c49
Remove custome string functions 2020-12-15 10:59:15 +01:00
Hannah von Reth 29c6f44124
Logging: Print enum before cast in SqlQuer::bindValue 2020-12-15 10:59:15 +01:00
Hannah von Reth b9638bc778
Fix warning
warning C4573: the usage of 'QObject::disconnect' requires the compiler to capture 'this' but the current default capture mode does not allow it
2020-12-15 10:59:15 +01:00
Hannah von Reth e38b43123c
Log: Only print 'Saved account settings' in debug mode
Don't log that there was no error...
2020-12-15 10:59:15 +01:00
Hannah von Reth c9ee0a0343
Log: Improve log message [ info gui.folder ]: Folder sync result: 4...
by including the name of the folder and print the name of the result
2020-12-15 10:59:15 +01:00
Hannah von Reth fb34f8ea85
Gui: Don't try to display the wizard during shutdown
Fixes: #7936
2020-12-15 10:59:14 +01:00
Hannah von Reth 4f8928d35e
Remove dead code 2020-12-15 10:59:14 +01:00
Hannah von Reth c5b59bf3b1
Make ownCloud accassible on the Application object 2020-12-15 10:59:14 +01:00
Hannah von Reth 4645e69147
Remove ifdef(Q_OS_X11) code, there never was such a define.
As noone complained since I don't think anyone will miss the code
2020-12-15 10:59:14 +01:00
Hannah von Reth f932dfc648
VFS: Tell the vfs plugin whether we have multiple accounts
This allows us to decide on the presentation of the account
2020-12-15 10:59:14 +01:00
Hannah von Reth 7e91166d7a
CMake: Remove krazy2 support, we now use clazy 2020-12-15 10:59:13 +01:00
Hannah von Reth 7fdb842ed2
VFS: Prevent duplicated navigation panel icon
Issue: #7748
2020-12-15 10:59:13 +01:00
Hannah von Reth 6c2c544713
Log HTTP requests and responses
Issue: #7873
2020-12-15 10:59:13 +01:00
Hannah von Reth c92f70d4ff
Beautify flags 2020-12-15 10:59:13 +01:00
Hannah von Reth 2b95f919ad
Fix 3aeca58b316363dc12ad4b392750fc57e7a2965a 2020-12-15 10:59:13 +01:00
Hannah von Reth 6d2526a67d
Fix warning C4715: 'OCC::Utility::vfsCurrentAvailabilityText': not all control paths return a value 2020-12-15 10:59:12 +01:00
Hannah von Reth b492b69dfd
Fix 150a5b4d06600d140ddf05383fb74cda6ae6e941 2020-12-15 10:59:12 +01:00
Hannah von Reth 6fde08d9f7
Fix crash on settings migration
Fixes: #7878
2020-12-15 10:59:12 +01:00
Hannah von Reth fa87b899fb
Fix usage of QMessageBox
Fixes: #7874
2020-12-15 10:59:12 +01:00
Hannah von Reth 11b9e3fa61
Fix order of pluginkit commands and modernise 2020-12-15 10:59:12 +01:00
Hannah von Reth aaca3e7ce5
Use separate loggin category for upload v1 and ng 2020-12-15 10:59:12 +01:00
Hannah von Reth eed4ffb823
Wizard: Raise own window
The OAuth authentication brings the broweser to the front, once thats done the wizard continues.
But the wizard ist now most probably hidden behind the browser
2020-12-15 10:59:11 +01:00
Hannah von Reth baff0a6986
VFS Dialog: Don't enable on close button clicked
Issue: #7710
2020-12-15 10:59:11 +01:00
Hannah von Reth 1a1035d516
Remove unused struct 2020-12-15 10:59:11 +01:00
Hannah von Reth b15c308170
Remvoe now unneeded SyncRunFileLog::directionToStr 2020-12-15 10:59:11 +01:00
Hannah von Reth 4681421b62
Remvoe now unneeded SyncRunFileLog::instructionToStr 2020-12-15 10:59:11 +01:00
Hannah von Reth a1d8010eae
Cleanup moc_csync.cpp include 2020-12-15 10:59:11 +01:00
Hannah von Reth 4d615c31da
Rename csync_instructions_e -> SyncInsturctions 2020-12-15 10:59:10 +01:00
Hannah von Reth 8cbdb4451b
Remove now unneede csync_instruction_str 2020-12-15 10:59:10 +01:00
Hannah von Reth caa04f6adb
Make bit flags better readable 2020-12-15 10:59:10 +01:00
Hannah von Reth c803292829
Use Q_ENUM_NS for PinState 2020-12-15 10:59:10 +01:00
Hannah von Reth 38c4d5a406
Cookies: Do set cookies in DetermineAuthTypeJob too
As we don't support cookie based authentication anymore we can provide cookies here.
This fixes issues with loadbalancers access policy managers.
2020-12-15 10:59:10 +01:00
Hannah von Reth f073997aee
Cookies: Don't override cookies with outdated values
This code was actually not breaking most cookie handling by accident.
As the raw cookies where not split properly we added cookies with values like
"key: val; key2 = val2; key3 = val3"
When the code was corrected we overwrote the newer values in the jar with
the old ones from a request.
2020-12-15 10:59:09 +01:00
Olivier Goffart 317d3735d7
SocketAPI: fix status after a failure to move
Issue #7759
2020-12-15 10:59:09 +01:00
Hannah von Reth 85aefa4232
Sync: Fix handling of virtual files in error state
Issue: #7799
2020-12-15 10:59:09 +01:00
Hannah von Reth bcceb5c33d
[Gui] Implement raiseDialog on Windows
Issue: #7774
2020-12-15 10:59:09 +01:00
Hannah von Reth 12ae1e97c6
[SocketApi] Ensure listener still exists 2020-12-15 10:59:08 +01:00
Hannah von Reth 868b05f25b
Improve logging of issues during plugin loading
If the plugin could not be loaded the client calls qFatal
Make the loading warnings critical so they get printed before we crash
2020-12-15 10:59:08 +01:00
Hannah von Reth d63d4cdf62
Don't insert items into the folder model if selectiveSync is not supported
This fixes an assertion in FolderStatusModel::SubFolderInfo::resetSubs
rowCount reported 0 but we actually had items in the model
2020-12-15 10:59:08 +01:00
Hannah von Reth 9176afe263
Make sure all cases are handled 2020-12-15 10:59:08 +01:00
Hannah von Reth 9b0788bdf8
[Gui] Fix vfs dialog not showing on Windows 2020-12-15 10:59:08 +01:00
Hannah von Reth a9728b527a
Remove unused defines 2020-12-15 10:59:08 +01:00
Hannah von Reth 1dd01477c5
Use Q_ENUM_NS to pretty print csync enums 2020-12-15 10:59:07 +01:00
Hannah von Reth 5927beb08d
Fix potential null pointer access
https://sentry.io/organizations/owncloud/issues/1529161263/events/02509984b5ca42ffb3960d9c9e161414/?project=79001&statsPeriod=14d
2020-12-15 10:59:07 +01:00
Olivier Goffart b7193e6a0e
Folder Wizard: warn when adding a folder which is the parent of a sync'ed folder
issue #7741
2020-12-15 10:59:07 +01:00
Hannah von Reth 13c9d6431d
Fix expansion of tree view on newly added accounts
The change is based on 97ce20ac028660e6ae3dd0b98d4b487999d8768a

I removed a few lines of code there which are already part of fetchMore()

Fixes: #7336
2020-12-15 10:59:07 +01:00
Hannah von Reth fdc3b7c8da
[Wizard] Make vfs dialog blocking
Calling the callback after the receiver was deleted caused a crash
Fixes: #7709
Fixes: #7711
2020-12-15 10:59:07 +01:00
Olivier Goffart a6a0e361c1
fixup test 2020-12-15 10:59:07 +01:00
Hannah von Reth 106a35d242
[SSL] Print warning only if something changed 2020-12-15 10:59:06 +01:00
Hannah von Reth ba87fc9e78
[SSL] Properly restore user accepted certificats 2020-12-15 10:59:06 +01:00
Hannah von Reth c8dd333e31
[Sanity] Remove old ifdef 2020-12-15 10:59:06 +01:00
Hannah von Reth 9564e5e92e
Fix saving of cookies
Fixes: #7700
2020-12-15 10:59:06 +01:00
Hannah von Reth 3a3ccb0834
Don't hardcode PLUGINDIR 2020-12-15 10:59:06 +01:00
Olivier Goffart 7fd4a280f0
Make PluginFactory virtual to silent -Wnon-virtual-dtor warning
This is not necessary, but it also shouldn't hurt.
2020-12-15 10:59:06 +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 f81f96915f
ProxyAuthHandler Use QPointer instead of QWeakPointer
QWeakPointer::data is deprecated.
In this case we should use QPointer
2020-12-15 10:59:05 +01:00
Hannah von Reth 466e8abc91
[Core] Include more information about the OS in the user agent 2020-12-15 10:59:05 +01:00
Hannah von Reth edb51abdfd
Don't ignore file sync notification after an unlock
For a usual file sync event we check for actual changes in the local file,
after an unlock the local file might be unchanged so we need to sync it anyhow.

Fixes: owncloud/enterprise#3609
2020-12-15 10:59:05 +01:00
Hannah von Reth 3317e354f2
Prepend PLUGINDIR else its pointless 2020-12-15 10:59:05 +01:00
Hannah von Reth b6e8d47644
Use Q_ENUM on AuthType to get the name printed in the log 2020-12-15 10:59:04 +01:00
Hannah von Reth dabf7aaebc
Application: Allow to quit running instances by commandline 2020-12-15 10:59:04 +01:00
Hannah von Reth fa82a4aff3
Cleanup 2020-12-15 10:59:04 +01:00
Hannah von Reth 6c19b02888
Disable http2 support for now
Issue: #7610
2020-12-15 10:59:04 +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 4424eb7f07
AccountSettings: limit the clickable region of the 'add folder' button
Issue #7326
2020-12-15 10:59:03 +01:00
Olivier Goffart b97c0ed8a2
Network Settings: Show a warning that proxy settings do not apply to localhost
Only show this if at least one account is detected to have an url that looks
like localhost, because this could otherwise be confusing

Issue #7169
2020-12-15 10:59:03 +01:00
Olivier Goffart 392d3c257c
Discovery: Allow more HTTP error code to be treated as ignored dir
The original code from csync was stopping at any error.
But we have been whitelisting soeme http error code one by one
to ignore the directory instead of aborting the sync.
However, as there are more requests to continue the sync in case
of error, just ignore most HTTP errors

Issue #7586
2020-12-15 10:59:03 +01:00
Hannah von Reth 43c7e32ee1
[libsync] Export verifyFileUnchanged
This fixes Windows builds that are broken since #7562 was merged
2020-12-15 10:59:03 +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
Hannah von Reth 9807285abd
[Gui] Set proper hdpi attributes 2020-12-15 10:59:03 +01:00
Olivier Goffart fc0aeb53b1
Discovery: fix TestSyncVirtualFiles::testExtraFilesLocalDehydrated on windows
On windows we do a test to know if we should change the case of the files,
but that conflict with the test that checks if the file was still there
when the filename is actually the same. Which can happen with virtual files
as they have two representation (the one with and without suffix).
2020-12-15 10:59:02 +01:00
Christian Kamm 4c4cbf0d97
Vfs: Lots of tests and corrections for suffix edge cases
Avoid or deal with problems that happen when suffixed files exist on the
server or suffix and non-suffixed files exist locally.

See #7350, #7261.
2020-12-15 10:59:02 +01:00
Olivier Goffart 88f86a56b1
Discovery: Attempt to fix issue with windows VFS and new files
(or moved files)
As seen in the log of #7558, a conflict may be issued by mistake.

See investigation in https://github.com/owncloud/client/issues/7558#issuecomment-547385362

This hopefully fix #7558
2020-12-15 10:59:02 +01:00
Olivier Goffart 513b0c723c
Account Settings: change the color of info message from green to blue
To avoid confusion with the color of "success"

Issue #7403
2020-12-15 10:59:02 +01:00
Olivier Goffart 4d7ed8f62c
Wizard: fix compilation warnings about unused variables 2020-12-15 10:59:01 +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
Olivier Goffart 83d743b66b
When moving is allowed but deleting is not, do not restore moved items
Issue #7293
2020-12-15 10:59:01 +01:00
Olivier Goffart ee611e6004
Restoration items should appear in the sync protocol
When an item is downloaded because it is restored, it shall be shown in the
sync protocol.
(It is also going to be shown in the not synchronized for a short while, but
that's fine)
2020-12-15 10:59:01 +01:00
Christian Kamm 9d422284af
Discovery: Distinguish readdir and closedir errors 2020-12-15 10:59:01 +01:00
Olivier Goffart adbd3d869b
Fix warning about serverJob not being used
And fix a FIXME in the same time
2020-12-15 10:59:00 +01:00
Christian Kamm 89216daee6
Propagate dir: Never write the etag on remote mkdir #7481
It must always only be written once all children are successfully
propagated.
2020-12-15 10:59:00 +01:00
Hannah von Reth dc55617144
Ensure the url is complete before we validate it
Fixes: #6722
2020-12-15 10:59:00 +01:00
Christian Kamm c9476a11f4
Checksums: Explicitly close file before reporting result
To ensure it's no longer open when the finished signal fires.
2020-12-15 10:59:00 +01:00
Christian Kamm e91e1ca78f
Test: Disable local discovery parallelism in permission test
Adding parallelism broke the test because it depended on the order of
discovery.
2020-12-15 10:59:00 +01:00
Christian Kamm e596b55977
Discovery: Change local job signal signatures
To make it more explicit that data a copy of the data is transfered
between threads. (though Qt will make a copy of the arguments anyway)
2020-12-15 10:58:59 +01:00
Christian Kamm 71f71b38f1
Discovery: local job shouldn't be parented
Since it'll be deleted by the thread pool.
2020-12-15 10:58:59 +01:00
Christian Kamm 53a217d4e4
Don't store pointer to local job
There were crashes in the QPointer assignment. Possibly the thread pool
is done with the job and deletes it before the assignment is done.
2020-12-15 10:58:59 +01:00
Markus Goetz 26b5e36351
Discovery: List local directories from thread #7456 #7439 2020-12-15 10:58:59 +01:00
Markus Goetz 09a0dbbf82
Reconcile: Sort already during discovery #7445 2020-12-15 10:58:59 +01:00
Christian Kamm a5c6612883
ConnectionValidator: increase timeout to 57s #7456
When the gui thread blocks for several seconds it's possible for the
ConnectionValidator to timeout and decide that the account is
unreachable. It will then terminate all sync runs.

Increasing the timeout makes this less likely to happen. The tradeoff is
that real disconnects will not be detected as quickly.

This does not address the root cause but makes the symptom less likely
to appear.
2020-12-15 10:58:59 +01:00
Markus Goetz 41dc68f99c
Propagator: Delay job execution a bit #7439 2020-12-15 10:58:58 +01:00
Christian Kamm e37e954720
Discovery: Remove level of indent around moves
No code changes.
2020-12-15 10:58:58 +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 c9d1037622
Propagation: Fix delete-before-rename bug #7441
By introducing a PropagateRootDirectory job that explicitly
separates the directory deletion jobs from all the other jobs.

Note that this means that if there are errors in subJobs the
dirDeletionJobs won't get executed.
2020-12-15 10:58:58 +01:00
Markus Goetz 475117dd60
Propagator: Make sure we schedule only one job #7439
To not starve the event loop.
(There is still ~= 3 jobs running at the same time)
2020-12-15 10:58:58 +01:00
Christian Kamm 3446412d92
PropagateDownload: Don't try to open readonly temporaries
This situation could arrise when receiving a read-only share and the
temporary rename failed for some reason.

See #7419
2020-12-15 10:58:58 +01:00
Hannah von Reth f78c4f851b
Change Windows virtual files description to tech preview 2020-12-15 10:58:57 +01:00
Christian Kamm 0ac8a3e6be
Don't fatal on "Storage temporarily unavailable"
This is an unreliable workaround. The real fix will need to be deferred
to another release.

For #5088
2020-12-15 10:58:57 +01:00
Hannah von Reth afc9cd2f46
OwncloudWizard: Mark vfs as tech preview instead of experimental 2020-12-15 10:58:57 +01:00
Hannah von Reth e5a36c3bc6
CMake VFS: Enable us to provided vfs plugins from an external directory 2020-12-15 10:58:57 +01:00
Dominik Schmidt 7e4d24de2b
SocketApi: Avoid unneccessary conversions 2020-12-15 10:58:57 +01:00
Dominik Schmidt 06ac1c33e8
SocketApi: cleanup debug output 2020-12-15 10:58:57 +01:00
Dominik Schmidt 25cd52dd9f
Add ASYNC_ASSERT_ICON_IS_EQUAL command to SocketApi 2020-12-15 10:58:57 +01:00
Dominik Schmidt d1f9b1a4f8
Make findWidget more powerful 2020-12-15 10:58:56 +01:00
Dominik Schmidt 67656fb136
Add Q_PROPERTYs for gui testing 2020-12-15 10:58:56 +01:00
Dominik Schmidt 596154a01a
Switch GUI Testing SocketApi to Utf8 2020-12-15 10:58:56 +01:00
Dominik Schmidt 3288a36da6
Add GUI testing SocketApi extension 2020-12-15 10:58:56 +01:00
Hannah von Reth e97784bb9d
Don't use mutable lambdas as they hide where we modify work on a copy 2020-12-15 10:58:55 +01:00
Hannah von Reth 0f92713ce5
AccountSettings: Use switch, case to ensure we handle all cases 2020-12-15 10:58:55 +01:00
Christian Kamm bade7aedc6
Checksums: Add back QIODevice api
Because the winvfs plugin needs it. But be more careful about the
device's lifetime this time.
2020-12-15 10:58:55 +01:00
Christian Kamm 18e1098e38
Remove maxLogLines config option
It's no longer used.

For owncloud/docs#1365
2020-12-15 10:58:55 +01:00
Christian Kamm ea829f96ca
Download: Don't trigger too many concurrent hash computations
Previously the job would only become "active" when the downloads
started. That meant that arbitrarily many hash computations could be
queued at the same time.

Since the the file was opened during future creation this could lead to
a "too many open files" problem if there were lots of new-new conflicts.

To change this:
- Make PropagateDownload become active when computing a hash
  asynchronously.
- Make the computation future open the file only once it gets run. This
  will make it less likely for this problem to occur even if thousands
  of these futures are queued.

For #7372
2020-12-15 10:58:55 +01:00
Christian Kamm 8a5a185752
Fix 'unused parameter name' warnings 2020-12-15 10:58:55 +01:00
Christian Kamm c9dbe46542
Checksums: Fix crash due to threading issue
The checksum computation thread was potentially using a QFile that was
deleted in the gui thread.

For #7368
2020-12-15 10:58:54 +01:00
Christian Kamm a587cd3a13
AccountSettings: Fetch subitems after wiping them
That helps avoid empty lists after account creation #7336
2020-12-15 10:58:54 +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 61972c35a8
Discovery: Parse etag to be consistent with RequestEtagJob
This avoids unnecessary sync runs.

For #7345
2020-12-15 10:58:54 +01:00
Christian Kamm 38c466efbf
Vfs: Require local discovery after disabling vfs
Without it local files aren't guaranteed to be downloaded #6936.
2020-12-15 10:58:54 +01:00
Christian Kamm 55ee3f440b
Vfs: Remove old db record when dehydrating via rename
For #7338
2020-12-15 10:58:54 +01:00
Christian Kamm e6990bd04e
Vfs: Make move detection work with virtual files #7001
Previously a checksum computation could be done on a suffix-placeholder
file, making discovery believe that no move took place.
2020-12-15 10:58:54 +01:00
Christian Kamm 00dcf3ef59
Vfs: Ensure pins change with (de-)hydration
Previously an implicit hydration of a file in an online-only folder
would not change the pin state and cause a dehydration on the next
sync.
2020-12-15 10:58:53 +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 b34df4413b
Vfs: Improve strings for availability states 2020-12-15 10:58:53 +01:00
Christian Kamm 5bc2180478
Vfs: Preserve pin state on hydration
For #7322 and #7323
2020-12-15 10:58:53 +01:00
Christian Kamm fc52c5d0cd
Vfs: Retain existing data when enabling vfs #7302
Previously all local data was deleted because the root folder was marked
as OnlineOnly.
2020-12-15 10:58:53 +01:00
Dominik Schmidt 92f6d866e1
Add missing OWNCLOUDSYNC_EXPORT 2020-12-15 10:58:52 +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
Christian Kamm 0e9f030b0f
RequestEtagJob: Consistently parse etags #7271
Previously RequestEtagJob did return the etag verbatim (including extra
quotes) while the db had the parsed form. That caused the etag
comparison during discovery move detection to always fail. The test
didn't catch it because the etags there didn't have quotes.

Now:
- RequestEtagJob will parse the etag, leading to a consistent format
- Tests have etags with quotes, detecting the problem
2020-12-15 10:58:52 +01:00
Christian Kamm 69fa1e4775
UploadDevice: Fix windows issues #7264
- Close the UploadDevice to close the QFile after the PUT job is done.
  This allows winvfs to get an oplock on the file later.

- Don't rely on QFile::fileName() to be valid after
  openAndSeekFileSharedRead() was called. The way it is openend on
  Windows makes it have an empty filename.
2020-12-15 10:58:52 +01:00
Christian Kamm fb47419e84
Vfs: Move pin state if files move #7250
Previously renames of items didn't carry the pin state with them.
2020-12-15 10:58:52 +01:00
Christian Kamm 34dc5e4e88
Vfs: Don't let new local files start out unpinned #7250
If one adds a new file to an online-only folder the previous behavior
was to upload the file in one sync and dehydrate it in the next. Now
these new files get set to Unspecified pin state, making them retain
their data.
2020-12-15 10:58:52 +01:00
Markus Goetz 62d876b09a
OAuth2: Better error logging
This does not fix a bug, just was found while spotting a bug that was no bug.
For https://github.com/owncloud/enterprise/issues/2951
2020-12-15 10:58:51 +01:00
Christian Kamm 452ed56571
Upload: Read file chunks gradually #7226
Instead of all at once, to reduce peak memory use.

Changing UploadDevice in this way requires keeping the file open for the
duration of the upload. It also means changes to open(), seek(), close()
to ensure that uses of the device work right when a request needs to
be resent.
2020-12-15 10:58:51 +01:00
Christian Kamm a7852e3aba
Http2: Resend requests on ContentReSend error #7174
Since Qt does not yet transparently resend HTTP2 requests in some cases
we do it manually.

The test showed a problem where the initial non-200 reply would close
the target temporary file and the follow-up request couldn't store any
data. Removing that close() call is safe because there also is a
_saveBodyToFile flag that guards writes to the target file.
2020-12-15 10:58:51 +01:00
Olivier Goffart c335f69a65
Discovery: Do not abort the sync in case of error 404 (or 500)
Issue: #7199
2020-12-15 10:58:51 +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
Olivier Goffart 2c975b1e70
SocketAPI: Fix string claiming a folder is a file
Issue #7206
2020-12-15 10:58:51 +01:00
Markus Goetz 46c336503a
Log Window: Create and open folder properly #7166 2020-12-15 10:58:50 +01:00
Christian Kamm ee1078b768
owncloudcmd: log sync errors
Previously it was hard to debug some errors since the messages would not
show up in the output.
2020-12-15 10:58:50 +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 7774b8049e
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.
2020-12-15 10:58:49 +01:00
Christian Kamm 1e5ae77994
Fix logic for duration that an etag reply indicates connectivity
This got inverted accidentally when std::chrono was introduced.

For #7160
2020-12-15 10:58:49 +01:00
Christian Kamm 7f3f13fd97
Vfs: "free space" only shows when it has an effect #7143
To do this, introduce AllDehydrated availability and rename
SomeDehydrated to Mixed - it now guarantees there are also hydrated
items.
2020-12-15 10:58:49 +01:00
Christian Kamm 40d9fc4f4b
Vfs: Adjust and centralise action text #7143
Saying "Currently available locally" sounds more like an indicator than
"Availably locally" does. Centralizing translations avoids consistency
issues between shell context menus and sync folder context menu.
2020-12-15 10:58:49 +01:00
Christian Kamm 021f994584
FolderWizard: Don't crash when typing invalid drive #7041
When the user typed "x:" where the drive x didn't exist, the validation
function would loop forever. Now it shows a "path doesn't exist" error.
2020-12-15 10:58:49 +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 a4f357ee4b
Sqlite: Use FULL synchronous mode with non-WAL journal
According to the documentation DELETE+NORMAL isn't safe from corruption
on older file systems.
2020-12-15 10:58:48 +01:00
Christian Kamm 076e24f465
Log: Start logging immediately when "permanent logs" enabled #7146
Previously one would need to wait for the next sync run to create the
first log file.
2020-12-15 10:58:48 +01:00
Christian Kamm 772a210cc9
Mention selective sync when switching on vfs 2020-12-15 10:58:48 +01:00
Christian Kamm cfbcdc01db
Discovery: Improvements to doc comments 2020-12-15 10:58:48 +01:00
Christian Kamm fbe2dbf4ab
Discovery: Query data-fingerprint on root item
Previously the property wasn't queried, meaning the fingerprint logic
couldn't get triggered.
2020-12-15 10:58:48 +01:00
Christian Kamm c50f041c5b
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.
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 da40e84aec
About: Add remark about vfs plugin that's in use #7137 2020-12-15 10:58:47 +01:00
Christian Kamm 2bffde2600
Fix windows build 2020-12-15 10:58:47 +01:00
Christian Kamm 22234e0e73
LogWindow: Remove output, add "go to log folder" button #6475 2020-12-15 10:58:47 +01:00
Christian Kamm dcf34316fd
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.
2020-12-15 10:58:47 +01:00
Christian Kamm 590db28541
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.
2020-12-15 10:58:46 +01:00
Christian Kamm 2738f110f2
Sqlite: Update to 3.27.2 2020-12-15 10:58:46 +01:00
Christian Kamm cd10e3d28c
PropagateDirectory: Set initial dir mtime to server mtime #7119
It's still not synced in any way later.
2020-12-15 10:58:46 +01:00
Christian Kamm 69887c531e
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.
2020-12-15 10:58:46 +01:00
Christian Kamm fd9b01981b
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
2020-12-15 10:58:46 +01:00
Christian Kamm 4bab93b246
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.
2020-12-15 10:58:46 +01:00
Christian Kamm 5e5b0b3f76
Vfs suffix: Require suffix when creating placeholder files 2020-12-15 10:58:45 +01:00