1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-09-30 02:42:53 +02:00
Commit Graph

16764 Commits

Author SHA1 Message Date
Olivier Goffart
eb23776f16
Discovery: Fix renaming on windows
buf.type is ItemFileSkip because csync_vio_local_stat does not set this field
2020-12-15 10:58:16 +01:00
Olivier Goffart
beee123c80
New Discovery: Fix trailing slash causing failure on windows 2020-12-15 10:58:16 +01:00
Olivier Goffart
60b17cd128
Folder: update the folder version
Since the new index would crash old version of the client, we need to
upgrade folder version so they do not load in the client 2.5.0
2020-12-15 10:58:15 +01:00
Christian Kamm
7de453d439
Settings: Make FoldersWithPlaceholders group sticky
If virtual files are disabled on a folder it might still have db entries
or local virtual files that would confuse older client versions.
2020-12-15 10:58:15 +01:00
Olivier Goffart
ab85c60205
owncloudcmd: Read the server version from the capabilities
Issue: #6846
2020-12-15 10:58:15 +01:00
Olivier Goffart
3e4486c078
owncloudcmd: fetch the dav user
This is required to get the new endpoint working when the server
uses ldap or that the dav user is not the same as the login.

Issue #6830
2020-12-15 10:58:15 +01:00
Olivier Goffart
ec8c02dad0
Sharing: add the shareWithAdditionalInfo string in autocompletion results
Issue #6749
2020-12-15 10:58:15 +01:00
Olivier Goffart
380d7b8028
Migration from 2.4: fallback to move file by file if directory move failled (#6807)
Migration from 2.4: fallback to move file by file if directory move failed

This can happen if the directory already exist because, say, it was
created by the ownCloud outlook plugin which save its file in the same directory
2020-12-15 10:58:15 +01:00
Olivier Goffart
e20e1d110f
Move: Fix too many starting slashes in the destination header
QDir::cleanPath does not remove starting slashes on windows.
So use account::davUrl which is already cleaned

Issue: #6824
2020-12-15 10:58:15 +01:00
Olivier Goffart
dcfbde2a67
Wizard: Reset the QSslConfiguration before checking the server
Because a previous call with another demain might have set some
config for another server.

Issue #6832
2020-12-15 10:58:14 +01:00
Olivier Goffart
b820e46805
Fix compiler warning 2020-12-15 10:58:14 +01:00
Olivier Goffart
35967fc2d6
OAuth2: Refresh the token without aborting the sync
OAuth2 access token typically only has a token valid for 1 hour.
Before this patch, when the token was timing out during the sync, the
sync was aborted, and the ConnectionValidator was then requesting a new
token, so the sync can be started over.
If the discovery takes longer than the oauth2 validity, this means that
the sync can never proceed, as it would be always restarted from scratch.

With this patch, we try to transparently renew the OAuth2 token and restart
the jobs that failed because the access token was invalid.

Note that some changes were required in the GETFile job because it handled
the error itself and so it was erroring the jobs before its too late.

Issue #6814
2020-12-15 10:58:14 +01:00
Olivier Goffart
53a14c2041
HttpCredentials: initialize all member inline 2020-12-15 10:58:14 +01:00
Dominik Schmidt
5d9370594d
Disable autostartCheckBox if autostart is configured system wide 2020-12-15 10:58:14 +01:00
Christian Kamm
00edcf98a1
Discovery: Virtual file handling adjustments
- adjust virtual file path handing
- helpers for vfs suffix adding/removal
- helpers for isDirectory/isVirtual on SyncJournalRecords
- be clear about what PathTuple _local/_server mean
2020-12-15 10:58:14 +01:00
Olivier Goffart
58eaf9940a
Database: Add an index on the parent path
So we can quickly query the items in a parent directory

This uses a custom slite3 function, which means that when downgrading the client,
or using another tool to add entries in the database, any insertion in the metadata
table will produce an error: "unknown function: parent_hash()"
(This will crash the client 2.5)
2020-12-15 10:58:13 +01:00
Olivier Goffart
e45e57982d
Add missing export 2020-12-15 10:58:13 +01:00
Christian Kamm
b431f4ef0c
Discovery: Fix log output for instructions 2020-12-15 10:58:13 +01:00
Christian Kamm
ce420d77a8
Discovery: Don't rebuild invalidFilname regex each call 2020-12-15 10:58:13 +01:00
Christian Kamm
113124cde5
Discovery: Introduce smaller functions 2020-12-15 10:58:13 +01:00
Christian Kamm
4f6f706f40
Excludes: drop csyncTraversalMatchFun()
The new discovery can call the traversal match function directly.
2020-12-15 10:58:13 +01:00
Christian Kamm
1d4e4fafcc
Discovery: Add back virtual file instruction checks 2020-12-15 10:58:12 +01:00
Olivier Goffart
a4e139969c
Fix windows build 2020-12-15 10:58:12 +01:00
Olivier Goffart
8490664860
Account Settings: fix progress being written in white when there are errors 2020-12-15 10:58:12 +01:00
Christian Kamm
dd34cbc751
Virtual files: Wipe selective sync settings when enabled 2020-12-15 10:58:12 +01:00
Christian Kamm
60de1c9720
virtual files: show option only when branding allows it 2020-12-15 10:58:12 +01:00
Christian Kamm
251e01a440
Virtual files: Use theme to check for option availability 2020-12-15 10:58:12 +01:00
Olivier Goffart
94e63ef7b9
Account Settings: Add a context menu entry to enable or disable virtual files
Issue #6725
2020-12-15 10:58:12 +01:00
Olivier Goffart
18f6e346b8
Upload: Do not error out if the server do not send the X-OC-MTime: accepted header
If the server does not set the mtime, it is not a big problem for the
synchronisation.

The test was used before so we could do a PROPPATCH for server that did not
support this header. But now that all server supports that we don't need to
to the check. (We do not do the PROPPATCH since we got rid of the neon
dependency)

Apparently, it may happen that some backend don't support setting mtime
and this can lead to this error.

https://github.com/owncloud/client/issues/6797
2020-12-15 10:58:11 +01:00
Dominik Schmidt
a985ea8624
Do not select ownCloud in Finder after installation to fix #6781 2020-12-15 10:58:11 +01:00
Olivier Goffart
15eab07866
OAuth2: Store 'Account::davUser' in the config, and use that user for connecting
We need to use the user id to check if we are connected to the right account.
These might be different from the HTTP Basic Auth login. (LDAP setups)

When the account was configured as an oauth2 account form the wisard, the
http_user was already set correctly to the user id. But when the server is
upgrading from basic auth to oauth2, we need to pick the right login.

Note that Account::davUser() already defaults to the HTTP user when none
is set, so this means the upgrade will be fine if this is not set in the
config.

Issues:
https://github.com/owncloud/oauth2/issues/109
https://github.com/owncloud/enterprise/issues/2781
2020-12-15 10:58:11 +01:00
Olivier Goffart
75f66ddaa1
Local discovery: always recurse within touched directory
If the file system watcher tells us a directory was modified, we should
recurse into it because it means it is probably a new directory

Issue #6804
2020-12-15 10:58:11 +01:00
Christian Kamm
e10e953c66
PropagateUpload: Avoid crash due to cascading aborts
https://sentry.io/owncloud/desktop-win-and-mac/issues/698694072/activity/
2020-12-15 10:58:11 +01:00
Olivier Goffart
640cf0c71e
Fix leaks in tests
As discovered by AddressSanitizer
2020-12-15 10:58:11 +01:00
Christian Kamm
d1aedcfd3c
Discovery: restructure processFileAnalyzeLocalInfo 2020-12-15 10:58:10 +01:00
Christian Kamm
a2839bd40a
Discovery: easy conditions first in processFileAnalyzeRemoteInfo
Removing two levels of indent that way
2020-12-15 10:58:10 +01:00
Christian Kamm
76341904e9
Discovery: Add comments 2020-12-15 10:58:10 +01:00
Olivier Goffart
5a1c93d0ac
Discovery: make sure finished is not called twice, even in case of errors 2020-12-15 10:58:10 +01:00
Olivier Goffart
b86e1efc9a
Remove the backup deteciton code which was used for server < 9.1 2020-12-15 10:58:10 +01:00
Olivier Goffart
f666511a4b
Discovery: Remove stale DB entries
And test the Remove/Remove case.

This means we need to always query the database for all the entries.
This showed another small bug in the test in which sync item for virtual
files at the root could have a slash in front of them.
2020-12-15 10:58:10 +01:00
Christian Kamm
5683278fab
Discovery: Comments and visibility adjustments 2020-12-15 10:58:09 +01:00
Olivier Goffart
aa18e10ff5
Discovery: cleanups and comments 2020-12-15 10:58:09 +01:00
Olivier Goffart
b10b3e5eeb
Discovery: move checkMovePermissions to its own function 2020-12-15 10:58:09 +01:00
Olivier Goffart
edd866b32b
Discovery: Adjust the instruction in case of resolved conflict
When resolving a conflict because the file was just updated on the server,
we write all the metadata on the database immediatly, so INSTRUCITON_NONE
is enough and UPDATE_METADATA is not needed
2020-12-15 10:58:09 +01:00
Olivier Goffart
7cddaf82ab
ProcessDirectoryJob: always set _childModified to true, regardless the direction
This was like that to handle the case of CSYNC_INSTRUCTION_TYPE_CHANGE, but just add
a condition in this location.
2020-12-15 10:58:09 +01:00
Olivier Goffart
46510c2f39
Discovery phase: refactor some code in DiscoveryPhase::findAndCancelDeletedJob
Less code duplication
2020-12-15 10:58:09 +01:00
Olivier Goffart
1c2a3279bb
New Discovery Algorithm: more cleanups
- rename progress() to be more explicit
 - Make some more member of the discovery phase private
2020-12-15 10:58:09 +01:00
Olivier Goffart
2f8c77c54f
Fixup commit 835c9163374f42003aa2f7795ade3f4ff62c8877
The previous code considered the also HTTP 207 code without the
application/xml header to have this message.
httpCode 0 does not make much sense anyway.

This change the behavior to consider any 2xx without the xml header
to show this error message
2020-12-15 10:58:08 +01:00
Olivier Goffart
c009dae1ce
New discovery algorithm: fixups
Adapt reviews from ckamm in https://github.com/owncloud/client/pull/6738#pullrequestreview-164623532

- SyncJournalFileRecord: initialize everything inline
- Add more comments
- And some ENFORCE
2020-12-15 10:58:08 +01:00
Olivier Goffart
059f722b3b
Move Result to its own header 2020-12-15 10:58:08 +01:00