Commit Graph

125 Commits

Author SHA1 Message Date
1ec98ee46e fix: folder delete/new conflict will be "delete"
should enable someone to delete a folder even if there is a new/delete
conflict happening for some other users

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-10-07 08:51:02 +02:00
59d4b86b3a fix(macOS): replace deprecated Q_OS_MAC by Q_OS_MACOS platform detection
Qt documentation says Q_OS_MAC is deprecated and should not be used

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-09-25 09:49:53 +02:00
acd27f1068 fix(sync): allow leading space file names on Windows
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-07-07 09:39:50 +02:00
4fcf31cb0b fix(permissions): decode share "no download" permission
ensure we use currently existing server API to get the "no download"
permission

requires parsing some share-attributes new DAV property

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-07-01 14:27:59 +02:00
66129ccaad fix(test/sync): add a single sync engine test with long paths
unfortunately does not cpature the requirements for proper long path
handling on Windows

maybe an end-to-end test could capture this requirement

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-05 11:06:41 +02:00
415a6e4366 fix(propagator): touch folder paths if permissions changed
Extra safeguard to ensure that the usage of
`FileSystem::setFolderPermissions` won't start a new sync run if
FolderWatcher/inotify detects a change in the file metadata...

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-05-28 08:51:08 +02:00
9ab875af0d fix(permissions): handle properly CanRead permission from server
if Readable permissions is missing, do nto try to download the file

if a file was downlaoded but Readable permission is now missing, remove
it

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-26 18:45:06 +02:00
91c8a12d46 fix(moveToTrash): enable use of move to trash in some automated tests
should improve coverage for move to trash feature to ensure this is
working as expected by users

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-22 09:05:32 +02:00
00994aa9e8 docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-16 15:19:26 +02:00
690f751ff5 disable use of bulk upload for small files
this feature causes many issues with impact on users so we prefer to
disable it again

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-10 16:10:20 +02:00
4b50c1de31 use maximum chunk size to decide the size of a bulk upload request
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-10 14:31:07 +02:00
e1a55fae1c with release 32.0.0 md5 custom checksum is removed from bulkupload
makes our fake server require an md5 custom checksum for bulk upload
until version 32.0.0

starting with 32.0.0 this custom checksum must be empty

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-10 10:40:17 +02:00
17c31fff3a fix: try to correct mtime on upsyncs
Files with a modification time of less than 0 do usually not make sense
(and afaik the server doesn't accept them either).
--> attempt to update the modification time to _Time.now_ while
propagating

side note: I ran into this because KArchive/Ark(?) didn't consider the
extra time attributes on entries for a certain zip file, so it instead
used the standard time value of each zip entry which was set to <= 1980
for files and < 1970 for directories...

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-04-08 23:18:20 +02:00
86d2e21042 remove bogus check that tried to check for existing case clash conflict
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-08 17:15:14 +02:00
425b038850 Add test for syncing with bulk upload when there are errors.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-02-20 11:36:36 +01:00
4b176c21d4 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:21:45 +01:00
f198910534 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:21:45 +01:00
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
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
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
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
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
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
92390cc754 Add tests to remove all files when sycing with or without nextcloudcmd.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-06-28 18:18:08 +02:00
098f4ef164 better automated tests log
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-05-15 15:06:11 +02:00
274d866c19 fix failing automated test that erases invalid iterator
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-26 09:05:12 +02:00
3765df627b Fix test compilation
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-04-26 09:05:12 +02:00
b52906a8a6 Fix tests failure. Refactoring.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-04-23 12:18:12 +02:00
9ae60258e1 Unit tests for diverse conflicts in one folder.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-04-23 12:18:12 +02:00
4844f326c1 newly created folders will be read-only when needed
Close #6296

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-12 23:30:02 +01:00
bbc976c920 gather more information on exceptions that happen when running tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-12 23:30:02 +01:00
0b869247ef immediately flush logs in automated test of sync engine
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-12-14 14:39:47 +01:00
4672acb5a6 Unit tests for the type change.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-12-13 11:43:25 +01:00
8a73a9a6f5 Fix new typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-09-17 10:41:38 +02:00
2f5c164534 Enforce Chunk V2 API chunk size limits at the sync options level
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-31 15:25:00 +02:00
ac3fc531ff test that discovery of file names with UTF-8 is working
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-08-16 10:44:37 +02:00
1cd537f928 Add test for unmodified local files not getting mtimes changed upon upload to server
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-07 16:25:19 +08:00
0b13be663b Add test for correct reporting of existing folder overcoming size limit
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-04 17:42:35 +08:00
505021af03 enable debug log for some automated tests
should help investigate failure for automated tests

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-07-12 13:41:53 +02:00
9d830e94f9 Fix typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-06-21 08:47:13 +02:00
e6f003b00b Remove stale caseclash conflicts when one of conflicting files has been removed from server
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-06-15 10:13:22 +02:00
01ecb639ab use new connect syntax
mainly done using clazy and old-style-connect check

close #5426

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-28 09:36:27 +01:00
602b8db5e2 handle case clash conflicts in a similar way to content conflicts
introduce a new type of conflict for case clash filename conflicts

add proper handling including a new utility class to solve them and a
new dialog for the user to pick a fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-01-25 16:37:35 +01:00
089b677633 Fix SyncEngineTest failure when localstate is destroyed.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-12-15 10:32:10 +01:00
af49e1079a fix test and code to not stop on case clash errors
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-30 11:49:35 +01:00
b68754827c case clash should not prevent full propagation
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-30 11:49:35 +01:00
c379879e30 check that we update local file mtime on changes from server
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-22 15:08:46 +01:00
5175d186a4 Do not ignore return values for SyncJournalDB in unit tests.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2022-09-17 09:47:15 +02:00
b5a10d7829 add new tests dedicated for recovery scenario of wrong mtime on server
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-03-17 23:28:02 +00:00
d4081c99a7 prevent updating files when that would result in invalid mtime
ensure that we never try to sync a file with a sync that would result in
setting it up to an invalid mtime

test a recovery scenario with plain old sync folder and virtual files

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-03-17 23:28:02 +00:00