Commit Graph

986 Commits

Author SHA1 Message Date
Matthieu Gallien
5212df870c prevent infinite sync loop: delay retry after many errors
10 seconds for try 3 and 4
30 seconds for try 5 and 6
60 seconds for more

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-20 09:09:56 +00:00
Matthieu Gallien
0fd16d2d4e ensure correct behavioron Windows for invalid file names
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-19 13:12:37 +00:00
Matthieu Gallien
8deb1c57fc try to enforce the windows compatibility as guessed from server
for now simple rule to guess if the server has windows naming enforced

if windows naming is enforced, we enforce it for new files

if not, we do not care

for now limited to spaces removal

more to come

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-19 13:12:37 +00:00
Matthieu Gallien
7a7edd69ef automatic removing of invalid spaces in file names
to ensure compatibility with Widnows, we will remove automatically the
leading space characters in file name of new files or folders

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-19 13:12:36 +00:00
Matthieu Gallien
2b17a10457 enforce trailing and leading spaces for new files
enforce trailing and leading space rules for new files and only for new
files but on all platforms, not only windows

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-19 13:12:36 +00:00
Jyrki Gadinger
48c83f4c07 use TextArea instead of TextEdit for share note field
it's already styled properly as it's part of Qt Quick Controls, **and**
it allows for a placeholder text!

also changed the logic for displaying the text field a bit ...

Fixes #7847

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-02-14 13:23:14 +00:00
Matthieu Gallien
9949d0cb20 add test skeleton for OCC::FolderStatusModel
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-12 09:49:09 +01:00
Camila Ayres
f62efca6c4 Improve text returned when checking VFS availability.
- Display more clear error when adding local sync folder and when selecting remote folder.
- Modernize FolderWizardRemotePath::isComplete().
- Display the local folder path when warning that folder is already being synced.

Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-02-11 09:08:26 +01:00
Matthieu Gallien
ee4bfc5629 disable some parts of the auto tests for end-to-end encryption
those tests are now broken and we think they do not bring much value

for now parts of them will be disabled until we get better automated
tests

realized while doing this that the secure drop tests are not independent
of each other

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-07 09:12:29 +01:00
Matthieu Gallien
f42c944e6a partial fix for broken automated tests
will use different validation method for hardware stored certificates
and pure software certificates emited by the nextcloud server

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-07 09:12:29 +01:00
Matthieu Gallien
2a52ec33b0 add support to use PKCS#11 harware token to store certifice for e2ee
Close #5685

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-07 09:12:29 +01:00
Integral
356e4f9296 refactor: replace QString() with QStringLiteral() for better performance
Signed-off-by: Integral <integral@member.fsf.org>
2025-01-31 15:11:02 +01:00
Fredrik Eriksson
294bb1adb3 Enable netrc tests
Test for spaces in usernames and passwords is disabled for now as it's
not supported by current implementation.

Signed-off-by: Fredrik Eriksson <feffe@fulh.ax>
2025-01-03 14:46:33 +01:00
Matthieu Gallien
b2b5fb793c ensure no crash due to uncatched exception from std c++ lib
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-01-02 10:20:27 +01:00
Claudio Cambra
60da482b79 Use std::next rather than adding to iterator in tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-20 16:26:57 +01:00
Claudio Cambra
ab51b11ca3 Use QTimeZone in startOfDay for QDate in tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-20 16:26:57 +01:00
Claudio Cambra
271f2eb9b6 Replace aAsConst with std::as_const in tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-20 16:26:57 +01:00
Matthieu Gallien
321c583b69 allow dehydrating pinned LNK files
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-12-16 16:15:40 +01:00
Camila Ayres
638f3a8647 Update tests for folder check to match fix.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-12-12 12:15:44 +01:00
Claudio Cambra
d921411bd3 Replace dark/light icon roles with a single icon role in activity list model
We can just colour the relevant activity icon from QML based on the
palette text colour

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-09 11:11:37 +01:00
Matthieu Gallien
52e78b3ece when locking a file set If-Match header to ensure etag is correct
the file being locked may have been changed sinc the client synced it

so the server side file may have a modified etag. In such cases we do
not want to lock the file and would rather sync the nex server changes
before being able to lock the file

that would ensure that on client side the file being locked is matching
teh state of teh file on server side and would prevent inadvertently
overriding server changes

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-12-09 09:33:49 +01:00
Matthieu Gallien
60b1091e13 fix TestSyncConflictsModel by using locale aware test data
should ensure comparisons of locale aware text is compared against
locale aware test data

will remove portability issues especially on Windows

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-29 09:23:58 +01:00
Matthieu Gallien
f38c2b7f51 fix local discovery test for file names with spaces on windows
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-29 09:23:58 +01:00
Matthieu Gallien
9be169c856 fix regressions in automated tests for bulk upload
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-29 09:23:58 +01:00
Matthieu Gallien
71281cbd39 prevent out of bounds access in automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-22 11:14:21 +01:00
Matthieu Gallien
4923873ac8 ensure folder permissions are read-only when needed
a folder item must be set read-only if files or sub-folders cannot be
created

a folder item must be set read-write in all other situations

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-21 12:06:57 +01:00
Claudio Cambra
9406131e52 Add test for correct handling of live photo mov deletion
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-20 14:39:51 +01:00
Claudio Cambra
ed71524aeb Add setIsLivePhoto method to FileInfo
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-20 14:39:51 +01:00
Claudio Cambra
74651a0ca8 Add isLivePhoto property to FileInfo in syncenginetestutils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-20 14:39:51 +01:00
Matthieu Gallien
05b6db55c3 remove the enforcement of identical etag for a server side item MOVE
orignally added by https://github.com/owncloud/client/pull/6632

most probably a too strong assumption on the behavior of the Nextcloud
server

better check real item metadata like fileid, size or modification time

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-10-17 09:45:57 +02:00
Matthieu Gallien
f0908dbbfc handle NEW/NEW conflicts by being real conflicts
NEW/NEW conflicts could sometime be ignored and replaced by update
metadata instructions

we stop doing this and handle them like any other conflicts

that would cause more download from the server

those conflicts would be solved automatically in case this is not a real
conflict but the client was missing the server reply with the updated
metadata

will enable more changes to improve MOVE detection from server side

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-10-17 09:45:57 +02:00
Matthieu Gallien
7301ad3356 in automated tests, update modtime when modifying the content of a file
why one would not update the modification time when modifying a remote
file during automated tests

there is no reason to not update the modification time as this is what
is done by the server

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-10-17 09:45:57 +02:00
Matthieu Gallien
8a791713cd test syncing of read-only .lnk windows shorcuts
related to https://github.com/nextcloud/desktop/pull/7282

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-10-17 08:51:37 +02:00
Camila Ayres
0e218bc549 Add test testFolderMetadataWithEmptySignatureDecryptFails.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-10-16 11:51:01 +02:00
Camila Ayres
1d9b6e2e79 Use preprocessor directives in tests.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-09-27 09:06:11 +02:00
Camila Ayres
6532d3feeb Fix tests for trailing spaces on Linux.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-09-27 09:06:11 +02:00
Camila Ayres
2e750013be Add test testCreateLocalPathsWithLeadingAndTrailingSpaces_syncOnSupportingOs.
- Fix discovery tests for files with invalid names.
- Now leading/trailing spaces trigger an error only on Windows.

Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-09-27 09:06:11 +02:00
Matthieu Gallien
b27eb06386 disable our code for network timeout
seems we have an issue with Windows and QTimer instances used to detect
network timeout

workaround, find cause of https://github.com/nextcloud/desktop/issues/7184

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-26 16:11:37 +02:00
Matthieu Gallien
570749c89e changing default chunk size to 100MB
goal is to have better performance and uniform behavior between all files clients

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-26 10:56:53 +02:00
Matthieu Gallien
18bb41b410 add automated tests for complex move scenario
we rename the top folder and we rename a not direct child that is also
moved to another folder below the original renamed top folder

so
a/b/c
a/b/d/file

will be
e/b/c/f/file

with
a -> e
d-> f

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-12 09:50:27 +02:00
Matthieu Gallien
a118c0ad1e detect remnants read-only folders to delete: try to delete them
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-12 08:40:50 +02:00
Matthieu Gallien
f33674e679 do not ignore paths containing 2 "#" characters
those path may be in use on Windows and are legitimate

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-09 11:03:57 +02:00
Matthieu Gallien
abde33e7e5 add automated test for deletion of child items in read-only folders
should ensure we are able to get files or dolders be deleted by sync
engine within read-only folders

would happen as the result of changes on server side being propagated
locally or when using selective sync

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-08-21 14:38:21 +02:00
Claudio Cambra
eee3a090cc Provide Windows-compatible forbidden filename character in forbidden filenames test
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-08-21 09:51:39 +02:00
Claudio Cambra
071ab937af Add test for new forbidden filename capabilities
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-08-21 09:51:39 +02:00
alex-z
7501a03db6
Unit tests. Test .lnk file with a real shortcut file. Test will hang if QFileInfo is used on .lnk files.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-07-10 10:29:35 +02:00
alex-z
f70d1c1079
Support Windows .lnk files with VFS Cf API.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-07-10 10:29:21 +02:00
Camila Ayres
0160cec256
Fix renaming tests for files under group folders.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-07-05 12:58:38 +02:00
Camila Ayres
4afc033ee0
Add test to detect file renames in external storage.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-07-05 12:56:52 +02:00
Camila Ayres
ee3f2dd1f6
Extend capabilities test to include desktopEnterpriseChannel check.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-07-04 10:16:40 +02:00